Android – Localhost on Nexus One/Android

androidandroid-networkinglocalhost

If I plug the Nexus One to my computer via USB, is there a way for me to see http://localhost from the computer in the Nexus One screen?

Best Answer

localhost is the name given to the current machine. Consequently, browsing to localhost on your Nexus One would browse to your phone's most likely inexistant webserver.

Plugging it with an USB cable will not help, unless you can share your local network connection from your computer to your phone through it. You need to get your phone on your local network and browse to your computer's IP address.