Using the Windows Mobile 5.0 Emulators in Visual Studio 2005by Wei-Meng Lee
If you have ever developed mobile applications, you know the importance of using emulators. Emulators allow you to test your application on different types of target platforms without needing to buy all these devices (which is not practical, as it is almost impossible to test your application on all makes and models). And so the emulator plays a very important part in the development cycle: How realistically can it emulate a real device? Are you able to drag and drop files onto the emulator? Can you install applications onto the emulator?
In this article, I will explore the emulator tools support that shipped with Windows Mobile 5.0 and Visual Studio 2005, and how you can use them to help in your mobile application development.
What You Need
For this article, you will need the following:
- Visual Studio 2005 (Final Release).
- ActiveSync 4.1. ActiveSync is used to synchronize your computer and your Windows Mobile devices (Pocket PC and Smartphone). I'll show you how you can synchronize your emulator with ActiveSync.
- Windows Mobile 5.0 SDK. Visual Studio 2005 ships with only the Pocket PC 2003 and Smartphone 2003 emulators. If you are targeting Windows Mobile 5.0 devices, you need to download the following SDKs:
Creating a Windows Mobile 5.0 Application
Let's first start by using Visual Studio 2005 to create a Window Mobile 5.0 Pocket PC application. In Visual Studio 2005, go to File-->New Project, then select the Windows Mobile 5.0 Pocket PC project type and choose the Device Application template. Use the default name of DeviceApplication1 and click OK (see Figure 1).
Figure 1. Creating a new Windows Mobile 5.0 Pocket PC application
Deploying to an Emulator
Once the project is created, you will see a default Windows Forms. We are not really interested in populating this form; what we are interested in is deploying it onto an emulator. Press F5 to debug the application. You will be asked to select a device to deploy your application (see Figure 2).
Figure 2. Choosing the device to deploy to
Select Windows Mobile 5.0 Pocket PC Emulator and click Deploy. The emulator will be launched and then a while later the application is deployed onto it (see Figure 3).
Note: If you are deploying a Windows Mobile application onto an emulator for the first time, it may take a while for the application to load. This is because Visual Studio 2005 is busy installing the .NET Compact Framework 2.0 class libraries onto the device. Subsequent deployment will be much faster. For your information, Windows Mobile 5.0 devices do not ship with .NET Compact Framework 2.0; they come with .NET Compact Framework 1.0 in ROM.
Figure 3. The emulator and the deployed application