The SDKs for the various platforms include various emulators for you to test your Windows Mobile applications without needing to use a real device. For example, if your project is targeting the Windows Mobile 6 platform, you would see a list of emulators available for your testing (see Figure 18-17).

Figure 18-17
Once you have selected an emulator to use, click the Connect to Device button to launch it. To test your application, cradle the emulator to ActiveSync first so that you have Internet connectivity on the emulator. To cradle the emulator to ActiveSync, select Tools→Device Emulator Manager in Visual Studio 2008; right-click the emulator that has been launched (the one with the green arrow next to it); and select Cradle (see Figure 18- 18).

Figure 18-18
Now press F5 in Visual Studio 2008 to deploy the application onto the emulator for testing.
Testing Using Real Devices
While most of the testing can be performed on the emulators, it is always helpful to use a real device to fully test your application. For example, you will find out the true usability of your application when users have to type using the small keypad on the phone (versus typing using a keyboard when testing on an emulator). For this purpose, you can test your application on some of the devices running the Windows Mobile 6 Standard platform, such as the Samsung Black II (see Figure 18-19).

Figure 18-19
Testing your Windows Mobile application on real devices could not be easier. All you need is to:
1. Connect your device to your development machine using ActiveSync.
2. Select Windows Mobile 6 Standard Device (see Figure 18-20) in Visual Studio 2008.

Figure 18-20
3. Press F5. The application is now deployed onto the device.
Deploying the Application
Once the testing and debugging process is over, you need to package the application nicely so that you have a way to get it installed on your users' devices.
The following sections show how to create a CAB (cabinet) file — a library of compressed files stored as a single file — so that you can easily distribute your application. Subsequent sections explain how to create an MSI (Microsoft Installer) file to automate the installation process.
Creating a CAB File
An easy way to package your Windows Mobile application is to create a CAB file so that you can transfer it onto the end user's device (using emails, web browser, memory card, and so on). The following steps show you how:
1. Add a new project to the current solution in Visual Studio 2008 (see Figure 18-21).

Figure 18-21
2. Choose the Setup and Deployment project type, and select the Smart Device CAB Project template (see Figure 18-22). Use the default name of SmartDeviceCab1, and click OK.

Figure 18-22
3. In the File System tab, right-click on Application Folder, and select Add→Project Output (see Figure 18-23).

Figure 18-23
4. Select the RSSReader
project, and click Primary output (see Figure 18-24). Click OK. This adds the output of the RSSReader project (which is your executable application) to the current project.

Figure 18-24
5. Right-click on the output item shown on the right-side of the File System tab, and create a shortcut to it (see Figure 18-25). Name the shortcut RSSReader.

Figure 18-25
6. Right-click the File System on Target Machine item, and select Add Special Folder→Start Menu Folder (see Figure 18-26).

Figure 18-26
7. Drag and drop the RSSReader shortcut onto the newly added Start Menu Folder (see Figure 18-27). This ensures that when the CAB file is installed on the device, a shortcut named RSS Reader appears in the Start menu.

Figure 18-27
8. Right-click on the SmartDeviceCab1 project name in Solution Explorer, and select Properties. Change the Configuration from Debug
to Release
. Also, name the output file Release RSSReader.cab (see Figure 18-28).

Figure 18-28
9. In Visual Studio 2008, change the configuration from Debug to Release (see Figure 18-29).

Figure 18-29
10. Finally, set the properties of the SmartDeviceCab1
project as shown in the following table (see Figure 18-30).
Property | Value |
---|---|
Manufacturer | Developer Learning Solutions |