Thursday, August 2, 2007

Cradle a device emulator and access the internet

Pre-requisites:
Visual Studio 2005 is installed.
Microsoft ActiveSync 4.0 or later is installed.
An internet connection is available.

Often a device emulator attempts to connect to the internet via the pc and the following message is encountered: Cannot Connect - Unable to connect: You have no modem entries created, and no network card present.

Here is a simple walkthrough, with some tips, describing how an emulator can be launched from Visual Studio, cradle it via ActiveSync and access a web page on the internet (obviously, provided that the PC is connected to the net).


Step 1: Launch an emulator (say Pocket PC 2003 SE Emulator)

a) Start Visual Studio 2005.

b) Go to the Device Emulator Manager (Tools -> Device Emulator Manager)
A list of available emulators will be displayed in the Device Emulator Manager window.



c) To start the emulator, right click PC 2003 SE Emulator and select Connect.
The Emulator will start.



Step 2: Attempt to browse a web page via Internet Explorer

a) Launch Internet Explorer (Start -> Internet Explorer) from the Device Emulator and your web page url, say enter www.google.com.

The error message will be displayed: Cannot Connect - Unable to connect: You have no modem entries created, and no network card present.



Step 3: Cradle the emulator

The emulator must be cradled (as it would have been the case for a physical device) and connect it to the PC via ActiveSync.

a) To cradle the emulator, go to the Device Emulator Manager in Visual Studio (Tools -> Device Emulator Manager).



b) Right click on the connected emulator, and select Cradle.
The emulator will now be cradled and connected to ActiveSync.



Step 4: Access the web page (repeat step 3)
The Internet Explorer on the emulator will successfully browse to the web page.


Great, isn't it?

7 comments:

ashvin said...

Guys,

this also work successfully if, for example, an application is running on the emulator and is trying to access a page, or even a webservice, on another machine connected to your network.

Give it a try!

Ashvin

javed said...

how i wish that would end on the wiki :P

Anonymous said...

Great walkthrough, but I'm using Windows Vista so ActiveSync is out and Windows Mobile Device Center does not seem to know when the emulator is cradled ... This would be a BIG help if anyone knows.

David Cho said...

This is very helpful, but there is one crucial step missing here.

You have to configure ActiveSync to allow DMA connections.

Bharati said...

Hi
I cant Found Step 3(b) option plz help me

Thank You

Bharati said...

Hi
plz give me ans as early as possible
Thank you

ashvin said...

bharati, please install microsoft activesync.. you should have this.