Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android cannot access localhost?

I started a local http server on Android and it can be reached by other computers in the same local network. But if I try to access this server using opera on the same phone, it won't work. So this means we are not able to access localhost on Android? Thanks!

like image 235
echo Avatar asked Dec 25 '10 08:12

echo


People also ask

How can I run localhost app in Mobile?

On your mobile device's browser (any will work), navigate to http://<Local IP Address>:<port number> . For example, if I was serving on localhost:8080 and my local IP address is 123.45. 67.890, on my mobile device's browser I would navigate to http://123.45.67.890:8080 . The http:// is important, don't leave it off.

How do I access localhost?

If you acces "http://localhost" in the browser, the request will not be forwarded to the internet through the router, but will instead remain in your own system. Localhost has the IP address 127.0. 0.1, which refers back to your own server.


1 Answers

You shoud use next IP 10.0.2.2

like image 156
Yaroslav Boichuk Avatar answered Oct 12 '22 10:10

Yaroslav Boichuk