Android localhost url is not working for tomcat 7

156 views Asked by At

I am using tomcat 7 from Java EE eclipse i also made a code for server part. In android i also made a project and ran it and using HttPGet of server part Url but my getRequest is not working.

My server is working in that Url

http://localhost:8080/dhoom/index.jsp

And in my android project i used like this:

String URL = "http://10.0.2.2:8080/dhoom/index.jsp";

HttpClient user = new DefaultHttpClient();
HttpGet getRequest = new HttpGet(URL);

getRequest is not working need help thanks in advance.

1

There are 1 answers

0
Altmish-E-Azam On

Open your system's command prompt and run ipconfig command on prompt, you will find your local/public ip here this ip will depend upon your internet connectivity . If you are trying to access web application on lan then use above local ip with http port that should be ip:8080.

If you want to use on wan then you have to a static IP to access web application in your mobile application.