I want to connect my Android phone to XAMPP server of my pc to run my app on phone's browser (app is working fine with pc's browser).
I am using broadband connection. The only solution which I've got until date is through using wifi connection.
But, I am restricted to use LAN connection. How can I connect it without using a router?
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.
its very simple , - GOTO command line (Window + R [type cmd]) - type ipconfig , that will show the current IP address of your PC - write taht IP address on your Android Phone's browser with :80 e.g (http://192.168.x.x:80)
Done
localhost will appear on your Phone
ifconfig
in terminalipconfig
in cmd`sudo ufw disable
in terminalIf 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