http://www.developer.com/

Back to article

Challenging Windows Mobile 6.0


April 26, 2007

Foreword

All right, you finally have it—Windows Mobile 6.0—handy. Everyone can download the new SDK from the Microsoft site. What should you expect from next version of the operating system? Is it as revolutionary as Windows Mobile 5.0 was? The quick answer is NO. Phew! I believe many of us agree that this is really good news. No significant changes, no suddenly stopped-to-work applications, and so forth. Instead, the mobile developer community gets many important improvements that make a programmer's life much easier (if it may ever happen).

The new version tries to achieve a few main targets: better user experience, better support for 'screen resoultion aware'-applications, and simpler development and deployment of business applications, especially for so-called Line of Business (LOB) applications, such as such as accounting, supply chain management, and resource planning applications. LOB applications are usually large programs that contain a number of integrated capabilities and tie into databases and database management systems. Thus, they do require good OS support to be effective.

In the next sections, you will briefly consider and observe various features of Windows Mobile 6.0.

Naming Again

As it became a good tradition, Microsoft takes care about entertaining developers and has altered the product line name once again. If you liked Windows Mobile 5.0 for Pocket PC, Smartphone, or various combinations of those with Phone edition, you now may enjoy a couple new ones. You may use Windows Mobile 6.0 Standard (aka Smartphone), Professional (PPC Phone edition), or Classic (regular PPC). However, there are only two SDK available: Standard SDK for the first platform and Professional SDK for the rest. These changes are reflected in project templates names and emulator images. In addition, only the following desktop platforms are officially supported for development environment:

  • Windows Server 2003 Service Pack 2
  • Windows Vista
  • Windows XP Service Pack 2

So, if you still have Windows 2000 around, your chances to meet WM 6.0 might seem to be completely vanished. But, it is not that bad; you nevertheless may easily install the SDK (and all pre-requisites) and continue to develop on Win2K.

Tools & Co.

Windows Mobile 6.0 comes very well armed to fulfill its goals. It is really nice that the .NET Compact Framework 2.0 SP1 and MS SQL Server 2005 Compact Edition are included in the ROM by default, so you can focus on using them and don't need to bother with deployment. The cash profit is obvious.

The end user experience was also significantly improved, so now GUI looks great, shiny, and more standard across the whole product family. Windows Mobile 5.0 applications should work seamlessly on the new platform because it is fully backward compatible unless you have used an undocumented API.

The next thing to notice is Device Emulator 2.0. It was available for a long time in beta version, but now it is released. First, it is a true ARM emulator, so it launches device code just like its old buddy POSE on Palm OS did. This facility enables you to keep fewer build configurations and be sure you debug the same code both on the emulator and the real device. Besides, it supports a few nice features such as a battery charging level and several peripherals. With all the new features, Device Emulator significantly decreases the need of purchasing a real device, thus getting you additional cash relief. Developers may try and test applications on a wide range of form factors, ensuring that the final product supports as many devices as possible. Device Emulator 2.0 is faster than the previous version, so the debugging process becomes easier to endure.

There is also Cellular Emulator working together with Device Emulator. This great facility gives you the unique opportunity to test an application's behavior with incoming calls or SMS, connectivity problems, and so forth. It doesn't seem to work on Win2K due to missing entry points in WS2_32.dll, though. To use it with Device Emulator, you will need to adjust Serial Port0 in Device Emulator's configuration settings to match the one Cellular Emulator uses and then the Soft-reset Device emulator.

The last thing to note—but not the least—is the GPS testing utility: FakeGPS. It makes it possible for you to develop and test location-based services without the ultimate demand of a GPS device. As its name states, this utility simply fakes it. All you need to do is to enable it via GUI and feed an appropriate file as an input. FakeGPS does the rest for you.

If you have a look into the Tools folder, you will find a few more useful utilities; for example, Hopper, which helps you stress-test your application while sending input keystrokes rapidly. It may discover some hardly detectable issues at the early development stages, so once your application is deployed, you can be more confident it is stable. There are also Security Manager and other tools in there, so I encourage you to have a look and try them. The Security Manager tool saves you a lot of time when you need to understand why your application doesn't work without any obvious reason. It can show recent settings for a connected device or emulator and also setup security policies for the emulator. The process of signing is also simplified, so it takes fewer headaches to get your application running on the real device.



Click here for a larger image.

SDKs and Frameworks

This area was not actually significantly changed, but it became more standardized and robust. Now, you may develop one application to run under all platforms and care less if some APIs are supported on one of them.

The fact that .NET CF 2.0 and SQL Server Mobile are included in the default ROM is great news for developers. Apart from multiple improvements and fixes made in CF.NET 2.0, you can rely on the OS and not care about additional deployment modules. Microsoft works hard to increase the efficiency and productivity of managed development on mobile devices, so changes in the framework are expected and welcomed. I won't list all of them here, but just note a few:

  • Docking and anchoring of GUI controls
  • Enhanced keyboard support
  • New, improved, or reworked controls (for example, Notification control)
  • ... Here you can add a dozen other things

Interactions between managed and native code were also revised and improved. For instance, CF.NET defines the Handle property for all Windows Forms controls; this represents a regular Windows handle in native code and may be passed to Win32 API functions (or other C++ components) when required. Another great feature is the State and Notifications Broker. It informs your application about more than 100 different state changes and events occurring in the OS, such as Camera availability, BT device connections, WiFi state, and so on and so forth.

The Native APIs were also lined up with desktop versions. A good example is the Sound API that now allows you to play various sound formats such as MID, WMA, MP3, and WAV. If you have tried to play MIDI files on previous versions, you will warmly appreciate the fact that it is free now. There are also new controls like InkCtrl, so you may incorporate it to your applications.

Let me say a few words about Smartphone development. Before VS205, developers could not use the MFC library on that platform; this definitely made things more complicated. The latest versions of the OS and IDE allow you to utilize MFC's rich class libraries also for Smartphones (the only requirement is to link it as a static library). I have put a screenshot of a simple Dialog-based application running on the Smartphone emulator:

And, one final general thing about the SDK: samples and best practices guide. The WM 6.0 SDK has more that 100 samples that cover a lot of topics, so have a look there.

Pocket Internet Explorer could not be left without new features too, so in WM 6.0 it can run basic AJAX applications due to better support for XML and JavaScript.

Conclusion

Rephrasing one of reviews for the Razr phone, Windows Mobile 6.0 is as powerful as it gets. Learning from previous versions' experience, the Microsoft team did really a great job! With CF.NET and native API getting closer and closer to their desktop versions, developers may concentrate on the contents rather than solving device restriction issues. Enjoy it!

About the Author

Alex Gusev started to play with mainframes at the end of the 1980s, using Pascal and REXX, but soon switched to C/C++ and Java on different platforms. When mobile PDAs seriously rose their heads in the IT market, Alex did it too. After working almost a decade for an international retail software company as a team leader of the Windows Mobile R department, he has decided to dive into Symbian OS ™ Core development.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date