I am new in android and i try to get values from mysql from my own server. I write the following code everything is correct but when I debug http response null and execution skip the another code and got exception area.
Plz help me urgent
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://mysitename.com/getdata.php");
try
{
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
**HttpResponse response = httpclient.execute(httppost);**
HttpEntity entity = response.getEntity();
is = entity.getContent();
Log.e("pass 1", "connection success ");
}
**catch(Exception e)**
{
Log.e("Fail 1", e.toString());
Toast.makeText(getApplicationContext(), "Invalid IP Address",
Toast.LENGTH_LONG).show();
}
0 comments:
Post a Comment