-1

I have a Android phone with Hotspot that shares the phones internet to my computer. On the computer I have a Apache-server running, and I'm trying to access that server from my phone.

I've tried connecting to the local IP-address of the computer from my phone, but it doesn't seem to work.

Is this possible to connect, and if so, how?

Tompina
  • 726
  • 1
  • 9
  • 25
  • 1
    It is supposed to work. Please provide your computer ip and the configuration you made on Android to connect to the computer. – Cao Minh Vu Mar 19 '18 at 04:11
  • If they are on same network then local IP should work. What's the error? Timeout? Also you can trying using something like `ngrok` as shown below: [How to browse localhost on android device?](https://stackoverflow.com/a/20918195/1306419) – Shobhit Puri Mar 19 '18 at 04:11
  • Hi Try following question answer which will you give solution for that. https://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device – Dhaval Solanki Mar 19 '18 at 04:12
  • find your network address and gateway address . Then configure those settings to your computer (set static ip address). Make sure you have entered correct gatway address . For mobile sim their gateway address is slightly different. Once you have setup the address on your computer then you can access your website using that static ip address. Which sim you are using ? – Developer_vaibhav Mar 19 '18 at 04:29

1 Answers1

2

Try the following:

1. Open command prompt with Admin permissions and type ipconfig on

  • your PC's IP address, and

  • the IP address of your phone.

If all is well on your network, you should receive response pings from both your own machine as well as the phone. The important point here is that both your phone and local machine should be on the same network.

2. Try using the emulator (the latest ones are quite fast) on 10.0.2.2 as well as the IP address of your machine. This should definitely work.

Aks4125
  • 4,522
  • 4
  • 32
  • 48
Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
  • I tried all that, but sadly it appears that my phone is not connected to the same network, even though the computer gets the IP from my phone Hotspot. An emulator did work, as well as ngrok, but I ended up connecting the phone and computer using an USB cable to make it work as fast as possible. (My internet connection is not fast at all). Thanks! – Tompina Mar 20 '18 at 04:20