Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Accessing webapp from android browser

 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

I have a web application which is right now working fine. Now my client want to access it from an android device. I tried giving this url in android browser which I normally do in pc "192.168.1.3:8080" now I cant even see the default page of tomcat. I am using tomcat 7.x.

After that I started to search and found this 10.0.2.2 and emulator stuff. To be frank I dint understand those. How could someone give a different url when my ip is something else.

I don't know android development but I am quite good in java. Now i am confused, do I need to write the full app again. Please, someone tell me a simple solution.



Thanks and Regards.
Adeeb
 
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing at all to do with Android, but with how the web and networking works. The 192.168.n.n addresses are local to the current LAN.
 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear.



I would just like to know that, do i need to rewrite the code so that it should work on android browser. I got this doubt because i am unable to connect to tomcat as I usually do from other pc on LAN. Can you please give an example of sample url?


Thanks.
Adeeb
 
Bear Bibeault
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Re-read my reply. This has nothing to do with Android, why would the app need to be rewritten?

If you want to access the web app from outside the LAN, it needs a to be addressed by its WAN IP, not the LAN IP.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Expose your server to the internet and have the android device access that IP instead of the IP that is only recognized on a LAN.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!