• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web service url not accessible from real device

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My Jersey web service url is working fine when I am accessing it from pc's or emulator's browser. But it is not getting accessed from real Android device browser.
This is the url-

http://192.168.0.107:8080/KommaaropmetjeaanbiedingWebServices/jaxrs/services

Please tell me what can be the reason? What I have to do to access it from actual device?
 
Swastik Dey
Rancher
Posts: 1602
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the device has a valid network connectivity? What exact error/exception are you getting?
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Astha Sharma wrote:Hi,

My Jersey web service url is working fine when I am accessing it from pc's or emulator's browser. But it is not getting accessed from real Android device browser.
This is the url-

http://192.168.0.107:8080/KommaaropmetjeaanbiedingWebServices/jaxrs/services

Please tell me what can be the reason? What I have to do to access it from actual device?

That URL would only be accessible from inside your own network: the 192.168.0.107 is an IP address assigned by your local network's router. Your phone would only be able to connect to it if it is on WiFi and on the same network (the phone's IP address should also start with 192.168.0.nnn).

If the phone is on the telco data network, or you want the application accessible from the internet as a whole you will need to:
1) Find out your external IP address
2) Setup your firewall to forward port 8080 to the correct local IP
3) Use the external IP address for the connection.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:Are you sure the device has a valid network connectivity? What exact error/exception are you getting?

Thanks for the reply Swastik. The error it shows is web page is not available when I access it from phone.

Steve Luke wrote:That URL would only be accessible from inside your own network: the 192.168.0.107 is an IP address assigned by your local network's router. Your phone would only be able to connect to it if it is on WiFi and on the same network (the phone's IP address should also start with 192.168.0.nnn). If the phone is on the telco data network, or you want the application accessible from the internet as a whole you will need to:
1) Find out your external IP address
2) Setup your firewall to forward port 8080 to the correct local IP
3) Use the external IP address for the connection.

Thanks for the reply Steve. I will try doing this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic