File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Accessing webapp from android browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Accessing webapp from android browser" Watch "Accessing webapp from android browser" New topic
Author

Accessing webapp from android browser

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

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.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing webapp from android browser