Today I have been doing some work with the Windows Mobile notification broker, which, for those who haven't used it is basically the event bus that Windows Mobile has for notifying applications when system properties have changed. For example in my application I can register an event handler for when the system state PhoneIncomingCall changes. This is useful as it means that my application can respond to device based events, instead of just the typical user interaction.
Unfortunately one of the issues with doing this type of development is how do you test your code. I could simply call my real device but that might get expense. Alternatively the Windows Mobile SDK now includes a cellular emulator which you can use in conjunction with the device emulators to simulate phone calls, messages and other connectivity.
Now I don't want to provide another How To article on the cellular emulator as there are a couple out there including a particularly useful one by Wei Meng Lee on getting started and a similar one by fellow Aussie, Dave Glover. However what I want to briefly point out is one of the issues I faced today in getting it to work. These two articles are both great starting points, however when I attempted to restart the emulator (after adding the peripheral COM port) all I would get is the black screen of death (equivalent of the blue screen for desktop machines - basically the device emulator fails to restart properly).
The fix to this issue, as indicated in the first of the common problems discussed by Wei, is to disable the bluetooth services. Luckily you don't actually need to go to the great pain of reinstalling the Windows Mobile SDK. Here's what you need to do:
- Stop the Bluetooth Support Service - As I don't need the Bluetooth service at all I've elected to stop it and set the Startup Type to Manual. Apparently once you have the cellular emulator working you can restart this service without causing any issues.
- Reinstall the XPVCom device driver - From an administrator command line issue the following commands:
C:\Program Files\Windows Mobile 6 SDK\Tools\Cellular Emulator>InstallXPVCom.exe uninstall
C:\Program Files\Windows Mobile 6 SDK\Tools\Cellular Emulator>InstallXPVCom.exe install
- Do a soft reset of your emulator - File -> Reset -> Soft
Once you have done these steps (in addition to those steps provided by Wei) you should be able to initiate a call from the cellular emulator and send sms messages to the device emulator. Note that you don't need to have the emulator cradled for this to work since the cellular emulator talks directly to the device emulator. This is particularly useful in light of the ongoing issues with both ActiveSync and the Windows Mobile Device Center...... still waiting for a reliable tool Microsoft!!!