Well, this week, I was studying Mobile Apps develompment for windows mobile 6 with C#.Net and I got some problems while trying to connect the device emulator to a Web Service (developed by me specially to this mobile app) that was running on my machine. No matter how I tried, I always got the error "Unable to connect to remote server" (Figure 1).
After a lot of reasearch in Google and lots of discussing with my teacher and with the fellows of dotNug, and with some friends, I discovered that I had to follow some steps to get the device emulator talking to my computer.
Environment:
- Windows 7 Professional Media Center Edition
- Visual Studio 2008 SP1
- Windows Mobile Device Center 6.1
- Windows Mobile 6 Professional App
- .NET 3.5 compact framework
- Windows Mobile 6 Professional Emulator
- Visual Studio 2008 SP1
- Windows Mobile Device Center 6.1
- Windows Mobile 6 Professional App
- .NET 3.5 compact framework
- Windows Mobile 6 Professional Emulator
First of all: When adding a web reference to a WebService in your Smart Device project, you CANNOT use localhost at the URL; use the [name of your computer] instead, because to the emulator, localhost is the virtual device itself. Ex.: http://machine_name/webservice1
Step 2: Install Microsoft Virtual PC, so it will install a virtual network interface which is required.
Step 3: Install Windows Mobile Device Center. It will synchronize the virtual device with the computer.
Step 4: Open Windows Mobile Device Center and allow DMA connections. This can be done by going to Mobile Device Settings ->Connection Settings -> Allow Connections to one of the following -> Select DMA
Step 5: Open Visual Studio opened in your mobile app
- In the toolbar select Device Options Icon (located next to dropdown with the emulators to select from)
- Under Device Tools -> Devices I select my Windows Mobile 6 Pro Emulator then click on Properties
- Click Emulator Options
- Select the Network Tab
- Check the first box (enabled NE2000 PCMCIA network adapter and bind to:)
- Select the name of your network card
Step 6: Run the emulator by running the application
- Go to Connection Settings in the EmulatorStart -> Settings -> Connections Tab -> Connections -> Advanced Tab -> Select Networks -> Choose My Work Network for both drop downs
Step 7: Open the device emulator manager, go to the model of the device you are using, right click and click Craddle. This will connect the emulator to your machine.
I hope this short tutorial can help you guys solving this issue.
sources:

2 comments:
well information you give to me. Thanks for the post about mobile application. the most importance for the mobile is the mobile application.iPhone Application Development
no problem!
I'm glad to know it was helpful!
Post a Comment