RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Mastering the Windows Mobile Emulators

The latest versions of the Windows Mobile 6 Professional and Standard SDKs allow you to test phone and SMS functionalities using the built-in Cellular Emulator—without needing to use a physical device.

icrosoft owes a large part of its success to the various development tools it has offered to the developer community. If you have experiences developing on other platforms, you would no doubt feel that Visual Studio is one of the most productive tools a platform can offer. This is even truer for Windows Mobile developers. For the past few iterations of the Windows Mobile SDK, Microsoft has progressively added new features to the SDKs to make development and testing as painless as possible. In the latest version of the Windows Mobile 6 Professional and Standard SDKs, you can now test phone and SMS functionalities using the built-in Cellular Emulator&3151;without needing to use a physical device.

To be successful in Windows Mobile development, you should first get yourself familiarized with the emulators and tools provided. This article will show you how to use the various emulators and tools available to make your development life cycle as effective as possible.

Launching the Emulators
The easiest way to launch the Windows Mobile Emulators is to use the Device Emulator Manager. The Device Emulator Manager can be launched from Visual Studio 2008 by selecting Tools—Device Emulator Manager. Once Device Emulator Manager is launched, you will see a list of the available emulators. What devices are on this list depends on the version of Visual Studio on your machine as well as the SDKs you have installed. To launch an emulator, right-click on the emulator you want and select Connect. Note that you can launch multiple emulators at the same time.

Within Visual Studio 2008, you will see the Device toolbar when you are editing a Smart Device application project. There are three items that will be of interest to you, shown in Figure 1.

Figure 1. Items of Interest: The various buttons in the Device toolbar in Visual Studio 2008.
Figure 2. The Device Options Dialog: Copy and configure the various emulators.

To deploy your application to a particular emulator/device, simply select the target device and press F5 to debug your application. The selected emulator/device will be launched automatically and your application deployed into it. If you want to launch an emulator without deploying your application, click the Connect to device button. The Device options button allows you to make copies of the various emulators and as well as configure their properties (see Figure 2).

For example, you may wish to test your application on a custom emulator without affecting the original emulator shipped with Visual Studio. In this case, you'd save a copy of the selected emulator (click the Save As… button) and give it a new name. The newly copied emulator will be located in the device list as well as in the Device Emulator Manager.

Now, you can customize the emulator copy and henceforth test all your applications on this modified emulator. To customize an emulator, launch the copy of the emulator that you have just created.

Figure 3. Customize: Removing the various items in the Start menu.
Figure 4. Configure: An emulator configured to simulate low battery power as well as mapped the serial port 0 to COM3.

Suppose you wish to remove the various items in the Start menu (see Figure 3). This is useful if you are using the Hopper tool to test your applications. To preserve the state of the emulator, simply shut down the emulator and when asked if you want to save its state, click Yes.

When an emulator is running, you can save its configuration information to a file. For example, you may have configured an emulator to simulate low battery power as well as mapped the serial port 0 to COM3 (see Figure 4).

Figure 5. The Configuration File: The .decfg configuration file stores the settings of the emulator.

To save this configuration, right-click on the emulator in the Device Emulator Manager and select Save-As. You will be asked to give a name for the configuration file, for example, LowBatConfig.decfg. When the emulator settings are saved, you will be able to find it under the category My Device Emulators in the Device Emulator Manager.

The LowBatConfig.decfg configuration file will be saved in the C:\Documents and Settings\\My Documents\My Device Emulators\ folder. Figure 5 shows the configuration file.

To apply the saved settings to another emulator, right-click on another emulator (it must be connected first, i.e. running) and select Reconfigure. Select the previously saved LowBatConfig.decfg file and the emulator will inherit the previously saved settings. In this example, the emulator will now have its serial port 0 mapped to COM3 and have its battery level dropped to 20 percent.

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