I am calling php url from android to recevive some string value.
My android code is as below:
private static final String BASE_URL="http://10.10.2.26/demo";
public static HttpResponse executeUrl(String action,String[] parameters) {
try {
HttpClient client = new DefaultHttpClient();
URI website = new URI(BASE_URL+"/"+action);
System.out.println("serverurl="+website);
HttpGet request = new HttpGet();
request.setURI(website);
System.out.println("5");
HttpResponse response = client.execute(request);
System.out.println("no error in execute URL");
return response;
} catch (Exception e) {
System.out.println("In error of execute URL"+e.getLocalizedMessage());
}
return null;
}
Following is my php code:
<?php
echo "kunal";
?>
after execution i receive null to android.