class sampleService extends AsyncTask<Boolean, Boolean, Boolean> {
@Override
protected Boolean doInBackground(Boolean... params) {
HttpClient httpClient = new DefaultHttpClient();
HttpGet del = new HttpGet("192.168.1.212:8000/c_f/4.0");
del.setHeader("content-type", "application/json");
try {
HttpResponse resp = httpClient.execute(del);
String respStr = EntityUtils.toString(resp.getEntity());
JSONObject respJSON = new JSONObject(respStr);
String far = respJSON.getString ("far"); //Check your type data to return in your web service.
Log.d("Service", far);
} catch(Exception ex) {
Log.e("Service","Error!", ex);
}
return null;
}
}