I can not figure out how to access localhost from a Genymotion android emulator. By the way, Im using MAMP.
Update
After genymotion update to 2.2 you can use 10.0.3.2
, ref
Another approach
To access your localhost through Genymotion is using your PC IP address. to get your IP address go to:
start -> cmd -> ipconfig
then search for IPv4, copy the IP and paste it in your URL. It should looks like the following:
String YourURL = "http://192.168.0.106:8888/your_script_location.php";
Hope this works too for you, give me a feedback.
P.S: if it didn't work, turn off the firewall and any anti-virus application you have in your PC.
10.0.3.2 didn't work (connection refused) but the address given by Virtual Box vboxnet0 which was 192.168.56.1 in my case worked.
Damn, I didn't realise it changed from
10.0.2.2
to10.0.3.2
after an update. Thanks for that!I changed only one digit in url ".setRootUrl("10.0.3.2:8080/_ah/api/")" and it worked for me! Great!
Worked Perfectly Thanks a lot.
10.0.3.2 worked for me on OSx and Genymotion 2.8.1. A bit surprised I didn't even have to add anything to my Apache vhost configuration or hosts file, it just works! :D