0

I'm developing an android app that connect with a restful web service which is on my tomcat local server.

The app works well on the emulator, however, it doesn't work on my real mobile. I use the IP from ipconfig, and both my laptop and my phone connected to the same Wi-Fi.

I tried to call the web service from the mobile browser but still, it doesn't see my localhost :(!

it shows me :

This site cannot be reached.

I searched a lot and all the solutions say that I have to connect both to the same Wi-Fi network and to use the IP from ipconfig command, which I did!

How can I fix this?

PS: I'm using 9090 as my port number, I don't know if that a reason?

Thank you.

ROM
  • 153
  • 3
  • 16
  • maybe you are using vpn or proxy. change your port to 8080 and tell us the results – iman kazemayni Mar 06 '18 at 21:00
  • You should configure your tomcat server to accept connections not only from an application on the same machine. You can also try a browser from another pc in the same network. It will not connect. And of course sometimes a firewall would prevent connections. Switch it off for a test. – greenapps Mar 06 '18 at 21:09
  • @imankazemayni can't change the port to 8080 it doesn't work since other service work on 8080. – ROM Mar 06 '18 at 21:45
  • @greenapps how can I do this configuration? I'm new in this field :( and how can I know if a firewall prevents connection? – ROM Mar 06 '18 at 21:46

0 Answers0