What can I do in Eclipse's Android emulator to connect it to my localhost web server page at http://localhost
or http://127.0.0.1
?
I've tried it, but the emulator still takes my request like a Google search for localhost or worse it says that it didn't found the page while my web server is normally running.
If you are in windows you can go to simbol system and write ipconfig and check what ip is assigned to your machine.
I needed to figure out the system host IP address for the emulator "Nox App Player". Here is how I figured out it was
172.17.100.2
.ip link show
command to show all network interfaces. Of particular interest was the eth1 interfaceifconfig eth1
command, shows net as172.17.100.15/255.255.255.0
172.17.100.1
, got a hit on `172.17.100.2'. Not sure if a firewall would interfere but it didn't in my caseMaybe this can help someone else figure it out for other emulators.
I do not know, maybe this topic is already solved, but when I have tried recently do this on Windows machine, I have faced with lot of difficulties. So my solution was really simple. I have downloaded this soft http://www.lenzg.net/rinetd/rinetd.html followed their instructions about how to make port forwarding and then successfully my android device connected to make asp.net localhost project and stopped on my breaking point.
my rinetd.conf file:
Where 10.1.1.20 is my localhost ip, 82 and 1234 my ports Also I have craeted bath file for easy life yournameofbathfile.bat, put that file inside rinedfolder. My bath file:
After starting this soft, start your aps.net server and try to access from android device or any device in your local network(for example Computer ABC starts putty) and you will see that everything works. No need to go to router setting or do any other complicated things. I hope this will help you. Enjoy.
For My Mac OS mountain Lion device :
Works perfect !