Issue
I'm working on an android application which allows users to create accounts on a database via my tomcat webservice. I've tested the webservice with a browser and it works fine. So I've tried to use make Http requests to that URL with my andriod app but it doesn't work.
Here is my code
try{
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet();
URI webservice = new URI("http://my-machine-ip:8080/Login/login?username=jimmy&password=javajava");
request.setURI(webservice);
HttpResponse response = client.execute(request);
}catch (Exception e1) {
e1.printStackTrace();
}
I have also set the internet permission. <uses-permission android:name="android.permission.INTERNET" />
Checking my log I have a connection error
05-31 17:46:50.299: W/System.err(17395): org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.0.3:8080 timed out
enter code here
Solution
Apparently, this was a connection problem caused my my firewall. A quick reconfiguration of applications with access on the firewall has solved everything
Answered By - Amanni