I’ve been experimenting with writing programs for Windows Mobile. I write the code in Visual Studio and use it to run the program in a Windows Mobile device emulator. The app I’m working on needs an internet connection but it is not obvious on how to configure the emulator to make that happen. I came across the following instructions on how the emulator can access the same network connection as the host (dev) machine and though I’d share.
Note: see the end of this post for info on prerequisites and even how to write a managed Windows Mobile application.
Enabling Network Connectivity on the Device Emulator
When Device Emulator is started, it starts like a device that is not cradled. In this state, it has no connectivity to the Internet. There is no data plan provided by a mobile operator. Therefore, the Device Emulator also lacks over-the-air connectivity. There are two ways to enable network connectivity by using Device Emulator:
Note If the emulator is running inside a virtual PC, see To enable network connectivity on an emulator running inside a Virtual PC.
The following steps describe how to connect the emulator to the Internet by cradling it. This method connects to the Internet by using an ActiveSync pass-through.
To cradle the emulator by using Windows Mobile Device Center (or ActiveSync)
- or -
Select Setup your device.
After it is connected, the emulator will have Internet connectivity.
The following steps describe how to connect the emulator to the Internet by using the virtual machine network services driver.
To connect to the Internet by using the virtual machine network services driver
If the emulator is running inside a virtual PC, you must perform additional steps to enable network connectivity. We will refer to the physical machine as the host machine and to the operating system running inside Virtual PC as the virtual machine. These instructions assume that the virtual machine is installed and ready to run on the host machine.
To enable network connectivity on an emulator running inside a Virtual PC
Make sure that the host and virtual machines are now connected through the Microsoft Loopback adaptor. You can now to connect the emulator to the Internet by using the virtual machine network services driver.
For reference, writing a managed Windows Mobile application can be done as follows: