Programming Windows Mobile 5.0 Applications Using the .NET Compact Framework Microsoft has recently launched the Windows Mobile 5.0 platform for Pocket PCs and Smartphones. With the proliferation of Windows Mobile-based devices in the marketplace, companies are gradually mobilizing their enterprising applications to let their staff gain the competitive mobile advantage. Coupled with the launch of Visual Studio 2005, the .NET Compact Framework is now in its second generation-version 2.0. | " | From a developer’s viewpoint, Windows Mobile 5.0 exposes many of its APIs as managed classes, thereby allowing developers using the .NET Compact Framework to easily build compelling applications that were once only possible to native developers.
| " |
In this article, I will demonstrate some of the new managed APIs made available by Windows Mobile 5.0 and the .NET Compact Framework 2.0. I’ll focus on the classes that are of interest to managed developers. (I won’t cover the new APIs that are only available to native developers.) Devices In recent months, vendors have been busy pushing out new Windows Mobile 5 devices and consumers now have many choices. The market seems to favor Pocket PC Phone Edition devices as these devices can easily replace your mobile phone with more functionality. When the JASJAR from i-Mate (Figure 1) was launched, it was the world’s first Windows Mobile 5.0 3G-enabled GSM/GPRS Pocket PC with Wi-Fi capability. Everything you want on a Pocket PC, it basically has them-Wi-Fi, Bluetooth, USB, SD slot, VGA-resolution screen, swivel screen, landscape and portrait modes, phone capability, built-in cameras (it has two-one on the back and one at the front of the screen for video conferencing), as well as an illuminated QWERTY keyboard.  Figure 1: The i-Mate JASJAR.I tested all of the code examples in this article on the i-Mate JASJAR. Visual Studio 2005 Microsoft’s release of Visual Studio 2005 makes developing Windows Mobile applications much easier. Using Visual Studio 2005, developers can target different platforms (Pocket PC 2003, Smartphone 2003, Windows Mobile 5.0 Pocket PC, and Windows Mobile 5.0 Smartphone; see Figure 2). In addition, you can use either the latest .NET Compact Framework 2.0, or the older version 1.0.  Figure 2: Developing mobile application on the different mobile platforms.Once the two SDKs are installed, you will see the new Windows Mobile 5.0 Pocket PC and Windows Mobile 5.0 Smartphone project types in Visual Studio 2005. The Windows Mobile 5 SDK ships with emulators of different flavors-Pocket PC as well as Phone Edition emulators, each with QVGA or VGA screen, and the emulators come in rectangular and square form factors. In addition, you can also download the various localized Windows Mobile 5.0 Pocket PC emulator images (see http://www.microsoft.com/downloads/details.aspx?familyid=EEC33AE3-C129-4C25-ABAA-18E8E842178F&displaylang=en) for testing your applications on localized Windows Mobile platforms. Visual Studio 2005 also makes it easy for developers to change the target platform of their application. For example, if you’ve designed an application for the Windows Mobile 5.0 platform, you can convert it to the Pocket PC 2003 platform, perhaps to support users that are still using the older devices. To convert the target platform of an application, you simply need to right-click on the project name in Solution Explorer and select Change Target Platform. Improved Emulator Support Visual Studio 2005 offers better emulator support than did previous versions of Visual Studio. You can use the Device Emulator Manager from the Tools menu and then choose Device Emulator Manager…) to synchronize with ActiveSync on your desktop. This ability allows you to better test your applications, such as testing how a setup application will install your application on a real device, etc. | & | | 
By: Wei-Meng Lee
Wei-Meng Lee is a technologist and founder of Developer Learning Solutions (http://www.learn2develop.net), a technology company specializing in hands-on training on the latest Microsoft technologies.
Wei-Meng speaks regularly at international conferences and is the author of ASP.NET 2.0: A Developer’s Notebook and Visual Basic 2005 Jumpstart (both from O'Reilly Media, Inc).
Wei-Meng is currently a Microsoft Device Application Development MVP.
Contact Wei-Meng at weimenglee@learn2develop.net.
| Fast Facts | | Visual Studio 2005 is the premier development platform for Windows Mobile .5.0. This article explores its new capabilities in detail. | |
|