Windows Mobile Device Emulator: Installment 2 – Configuration of the NE2000 Adapter

May 22, 2008

Share on LinkedInShare on Facebookvia@entmobile+1Save on DeliciousDigg Thishttp://www.enterprisemobile.com/blog/Share via email

Here is the follow-up installment #2 on device emulator configuration.  You may want to read installment #1 first.

I often need to test our code across various versions and SKUs of Windows Mobile.  For instance, I need to test one feature across WM 5.0 Smartphone, WM 5.0 Pocket PC Phone Edition, WM 6.0 Standard, WM 6.0 Professional and, of course, the newer WM 6.1 SKUs.

When testing, you often want to use a hard/cold booted device for the most reproducible results.  Cold booting and then reconfiguring a bunch of devices is super time consuming.  Even if using the device emulator, configuration can be time consuming.

Another important issue is network availability.  Much of my testing requires a network connection for client/server applications.  I used to connect my emulators using Desktop Passthrough via Desktop ActiveSync or Windows Mobile Device Center on Vista.  This setup invariably led to the following problems:

  1. Time spent in setup of the work/internet connection manager settings every time I reconnected
  2. ActiveSync automatically sets your HTTP proxy which is sometimes not desirable. Unfortunately, the method used by activesync to gather the proxy and proxy port from the desktop can lead to errors. For instance, our outbound proxy operates on port 8080. But, activesync configures the device to use port 80 which then causes “work” connections to internet web sites to fail.
  3. You can only connect one emulator at a time to activesync. If you want to test across multiple emulators simultaneously, you cannot use ActiveSync.
  4. ActiveSync Desktop passthrough only supports http/https traffic. If you want to use other ports/apps, it won’t work. For instance, I’ve been testing an ICMP ping application and cannot use it through desktop activesync.

These issues can be solved by utilizing the built-in NE2000 NDIS network adapter that comes with the device emulator. Here is a set of steps that I use for setup.  After you finish setup, you can save the device emulator state and when attempting a new test case, you simply close and re-open the emulator for full cold boot with configuration intact.

Here is how I go about configuring the emulator to meet my testing requirements.

First, if you’ve ever saved state on the device emulator image before, right-click the image in the Device Emulator Manager and choose “clear save state”.  This provides a true default, factory-reset image as your starting point.  There is an option in the emulator’s file menu for cold reset, but it does not take the device back to a truly “clean” state.

Next, in the Device Emulator window, open the File menu and select “configure”.

In the “General” tab, you can configure a “Shared Folder”.  I like to share a folder located on my desktop to the device emulator by configuring the “shared folder” setting.  Once configured, you can open desktop files in the emulator by browsing the “storage card” volume in file explorer on the device emulator.  If using multiple emulators, you can set them to all use the same shared folder.  This allows you to copy files into the desktop folder and then open the identical file on all emulators.  For instance, you could copy CAB Provisioning Files (.CPF) to the desktop shared folder and execute them from the device emulator’s file explorer to easily configure the device.

In the “Network” tab, you can setup your emulated NE2000 adapter.  Just select the checkbox for “Enable NE2000 PCMCIA network adapter and bind to:” and select “Connected Network Card”.  The NE2000 will bind to the first network adapter it finds on the desktop computer after you click OK on the “Emulator Properties” checkbox.

You may find that you still can’t connect to known servers using the device emulator’s Mobile IE browser.  That is likely due to work/internet settings.  Here is what you do:

  1. Open settings
  2. Open connections:
    1. On PPC, click the “Connections”
    2. On Smartphone, just open the “Connections” setting menu item.
  3. On PPC emulators, route “Network Cards” to the correct network: “work” or “internet”. If your desktop is connected to a private/work network with a firewall that requires proxying to the internet, set “Network Cards” to point to “Work”. NOTE: Smartphones are hardcoded such that the NE2000 adapter always routes to “work”. You can see this by by opening the “menu” and selecting “Adanced” on the “Connections” menu. You won’t be able to change it to route to “internet”. If you don’t configure a proxy setting, it won’t make a difference.
  4. If you selected “work”, then you likely need to configure a proxy. Open “Connections” again as you did in step 2 above.
    1. On PPC, open “Connections” and click the hyperlink for “Edit my proxy server”
    2. On Smartphone, open “Proxy” and click “Add” off of the Proxy “menu”
  5. Test your connection by opening both an internet web site and a private/work network website in Mobile IE. You may need to change your proxy and/or network card routing configurations.

At this point, you may want to configure some of the following:

  • Root and intermediate certificates
  • Mobile IE Favorites
  • Application installations

After you’ve finished creating your base image configuration, click the “File” menu in the device emulator windows and select “Save State and Exit”.  After the save process is finished, reopen the same emulator image and you’ll find that its configured and ready for your first test case!  After you’ve completed a test case, close the emulator, but do NOT save the emulator image or it will overwrite your carefully created image.  Re-open the image and you’ll find that you are right back to your base image configuration and ready for your next test case.

If you are using multiple device emulator instances to test a client/server application, you can have them all open and connected at once to run the test case simultaneously.

If you choose to use activesync, then use it after you’ve created and saved your base image, if possible.

Hope this helps!

Dave Field, CISSP, MCP
Device Management and Security Architect
Enterprise Mobile, Inc.

9 Responses to “Windows Mobile Device Emulator: Installment 2 – Configuration of the NE2000 Adapter”

  1. Santosh says:

    Can you please tell us, how to install/deploy apps to standalone windows device emulator (PocketPC), without the intervention of Visual studio IDE in other words to deploy java based apps?

  2. dfield says:

    Hello Santosh,
    Here at Enterprise Mobile, we’re .NET developers. However, I did find a good set of blogs that may address your questions at http://puthli.blogspot.com/. Unfortunately, the VS IDE does not directly support java dev with a connected emulator in the same way that .NET CF is supported. There may be an add-in out there somewhere that enables this scenario, but I don’t know of it offhand.
    Thanks,
    Dave Field

  3. Lenny Li says:

    we wish to run multiple instances of the windows mobile emulator to simulate multiple network connected PDA, but it seems that we cannot get the network connection connected after the first windows mobile is connected. can someone elaborate how we can make it work?
    thanks!

  4. [...] get network connectivity you can follow the same steps as with previous emulators. Please see this blog posting for additional [...]

  5. Adit says:

    I am working with WM5 emulator. I remember configuring the shared folder and using it as storage card. BUt now i am not able to view it. If i check the File -> Configure -> General -> Shared Folder, still the path is there, but im not able to see the Storage card. Also if i check the Settings -> System -> Memory -> Storage Card, it shows storage card not installed. I tried so many times reconfiguring the shared folder without success. What could be the problem?

  6. dfield says:

    It may be an issue with folder sharing on your PC. You may need to change settings that allow folder sharing in “Network & Sharing Center”

  7. Souhail says:

    Hi

    I have an nk.bin file, that i need to add to the list of my emulators. not sure how to do this, are there any scripts that could generate a emulator configuration files?

    Thanks

  8. dfield says:

    Hello,
    The raw binary emulator image is stored as a .bin. And, the supported way to create an emulator image is using a Windows Mobile variation (the OEM Adaptaation Kit) of the Windows CE Platform Builder tool. Problem is that you must be Microsoft OEM partner and registered as an “in-ROM IHV” to get it. So, I suspect that you may be able to find a tool for conversion of the .nk to .bin and then register it with the device emulator manager. A quick search seemed to indicate this. See xda-developers.

  9. Souhail says:

    Hi

    But my file is already in a .bin format: nk.bin
    which i compiled with my platform builder.

    i tried creating a .decfg xml file and put it in the My Documents/My Device Emulators folder and i have it show up in my device emulator list but i think i have some of the fields in the xml file inccorectly set as i cant connect to the device. i think it has to do with some of the constant that i have no idea about. here the xml content:

    My Plaform

    1033
    true
    true
    Left-Alt
    270
    {B89C49AD-197F-4CB4-A525-D81D0944EEAF}
    Sirius Custom Emulator
    <!–c:\1.dess–>
    true
    true

    193

    C:\Documents and Settings\Souhail\My Documents\My Device Emulators\NK.BIN
    c:\Flashfile
    256
    ARMv5
    TDI
    true

    c:\
    00001A1A190B
    00001A1A190B
    true

    COM3
    none
    none

Leave a Reply