Android : I am getting error in real device but work perfectly in emulator

on Thursday, July 10, 2014


this is my code ..this work perfectly in emulator bu some problem occurred in real device ..plzzz help me


Error in http connectionjava.net.UnknownHostException: my.url.com



try{

HttpClient httpclient = new DefaultHttpClient();
HttpPost http = new HttpPost("http://my_url.com/folder/login.php");
http.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
}catch(Exception e){
Log.e("log_tag", "Error in http connection"+e.toString());
}

0 comments:

Post a Comment