I’ve managed to generate requests for it and it works great in the win32 app. The problem comes when I try to connect to the web service with the android app. It will always give “code: 7” (couldn’t connect) but the funny thing is that it will work if I connect to whatever web page.
So I wonder why it won’t let me connect to localhost, also note that I’m using the emulator since I don’t have a device.
Seems that android maps your PC to ip 10.0.2.2, at least when running through emulator.
Or else find the local IP of your PC (probably 192.168.1.XX) and use that instead.
May i know how you managed to connect your app to a web service? I need help in that.
Any sample code or link will be great.
I never deal with web service before.
Hi smit, first of all I was asking for connecting to a webserver hosted on localhost. When accessing 127.0.0.1 from your app inside the emulator the localhost is, in fact, the emulator.
To let the emulator access the webserver hosted on you PC you have to use 10.0.2.2. So for example if you are trying two builds of your app, one for Win32 and one for Android, you can do this: