Android : Pulling page content to string android

on Friday, October 31, 2014


I'm trying to pull a php page to string on android. The problem is that I can't get the response_str variable outside of the try. Whatever I'm doing it keep returning null. The URL return 1 or 0.


this is my code:



public String IsLoggedIn() {
String url_text = "http://klh-dev.com/lehava/lehava/system/isloggedin.php";
String response_str = null;
try {
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(url_text.toString());
ResponseHandler<String> responseHandler = new BasicResponseHandler();
response_str = client.execute(request, responseHandler);
}
catch (Exception e) {
}
return response_str;
}


Thank you, Morha13


0 comments:

Post a Comment