I want my localhost folder on my pc to be accessible by mobile phone connected using bluetooth/wifi. I am using WAMP. How do I do this?
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".
To access the server from itself, use http://localhost/ or http://127.0.0.1/ . To access the server from a separate computer on the same network, use http://192.168.X.X where X.X is your server's local IP address. You can find the sever's local IP address (assuming it's Linux) by running hostname -I . 127.0.
Here's a guide how to access your website through mobile:
http://www.logicspot.com/web-development-2/viewing-a-locally-hosted-website-with-your-smartphone/
Since you are using WAMP
. This is possible.
Just click your WAMP
icon on your system tray and choose the option "Put Online".
After doing so, go to your command prompt (Start -> Run -> Cmd [Press Enter]
) . Now type the command ipconfig
. You will see your system's IP. Make note of that IP. Say your IP is 192.XXX.XXX.XX.
Now you can access your localhost files as http://192.XXX.XXX.XX/myfile.php
which is synonymous to http://localhost/myfile.php
This URL can be accessed even from outside world. So be cautious ! :)
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