I'm receiving json data from my php page based on an ID value. The php is fine and I am receiving the JSON data + outputting it onto the textarea I want it in. Except, it comes with it's brackets and table name:
[{"analysis":TEST TEST TEST TEST}]
How do I make it output only the "TEST TEST TEST" part of my json output instead of all outputting all of it?
my async class
private class AsynMatchAnalysis extends AsyncTask<String, Void,String> {
@Override
protected String doInBackground(String... params) {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.0.3/ex/match_analysis.php");
String jsonResult = "";
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("ID", passedID.toString()));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream webservice = entity.getContent();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(webservice, "iso-8859-1"), 8);
analysisView.setText("" + reader.readLine());
webservice.close();
} catch (Exception e) {
Log.e("log_tag", "error converting result " + e.toString());
}
// jsonResult = response.getEntity().getContent().toString();
// passedView.append("" + jsonResult.toString());
//System.out.println(jsonResult.toString());
} catch (IOException e) {
}
return null;
}
}
editted for clarity