[Solved] How to parse a JSON string in Android?


Try using following code :

try {

    JSONArray jsonArray = new JSONArray(response);
    JSONObject jsonObject = jsonArray.get(0);

    JSONObject _id = jsonObject.getJSONObject("_id");
    String old = _id.getString("$oid");

    String member_id = jsonObject.getString("member_id");
    String sensor_name = jsonObject.getString("sensor_name");
    String value = jsonObject.getString("value");
   String date = jsonObject.getString("date");

}catch(JSONException e){
}

1

solved How to parse a JSON string in Android?