access my local server from my android virtual device?
I want to access a local server (installed开发者_C百科 on my machine ) trough my android virtual device, and i can't figure out how to do it ?
You need to make HTTP POST/GET to the server, or create simple PHP GET if the server is running any PHP script. Read more about HTTP Post/Get.
Also read how can you access localhost on your machine http://developer.android.com/guide/developing/devices/emulator.html#networkaddresses
Also note that the address 127.0.0.1 on your development machine corresponds to the emulator's own loopback interface. If you want to access services running on your development machine's loopback interface (a.k.a. 127.0.0.1 on your machine), you should use the special address 10.0.2.2 instead.
In addition to Nikola's answer - you should also be able to use an external ip address of your development machine.
精彩评论