10.0.2.2:8080 in web browser in emulator is not working

IhtkaS picture IhtkaS · Feb 2, 2014 · Viewed 27.4k times · Source

I have a wamp server in localhost. I tried to make http request from my android app. But cannot get it right. Many said 10.0.2.2:8080 will point to localhost from emulator. So i tried to open it in web browser from emulator. i typed in url as "10.0.2.2/cifi/test.php". But emulator popped error as "net:CONNECTION_TIMED_OUT"

Need explanation: how to make my wamp server in local machine to listen 10.0.0.2:8080 from emulator's browser.

Answer

TheCopycat picture TheCopycat · Feb 2, 2014

Your Wamp Server seems to be accepting only localhost connections.

Left click on wamp icon -> put online

Additionnally you should type a url http://10.0.2.2:8080/cifi/test.php instead of http://1.0.2.2/cifi/test.php