I am working on a Mobile website using jquery mobile and would like to test it using my android Phone browser.
My Windows 7 machine and android phone are on the same wireless network.
I normally access the mobile site from my machine: "http://localhost/index.php/doctor"
I tried accessing it using the wireless network IP address from my mobile: "http://192.168.1.3/index.php/doctor"
but, I get web page not available error.
How do I access localhost from my android phone?!
You can access your host machine with the IP address "10.0. 2.2". This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via "http://10.0.2.2:8080".
You are accesing localhost , meaning you have a web server running on your machine. To access it from Internet, you need to assign a public IP address to your machine. Then you can access http://<public_ip>:<port>/ . Port number is normally 80.
192.168.1.3 is the local network address. What you need to do, is get the external IP address, and put that into the phones URL. You can do this by going into the command line and typing ipconfig
, this should give you all your machines IP addresses, along with the external IP for your local webserver. I doubt this has anything to do with your firewall. More than likely, you just need to find the correct IP address for your local webserver.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With