2
{
    "terms": [{
        "offset": 0,
        "value": "Nerkundram"
    }, {
        "offset": 12,
        "value": "Chennai"
    }, {
        "offset": 21,
        "value": "Tamil Nadu"
    }, {
        "offset": 33,
        "value": "India"
    }]
}
rafsanahmad007
  • 23,683
  • 6
  • 47
  • 62
Chandana_Raj
  • 116
  • 2
  • 13

1 Answers1

2

Use this:

try{
JSONObject json = new JSONObject(jsonString);
JSONArray jsonArray = json.getJSONArray("terms");
for(int i=0;i<jsonArray.length();i++){
     JSONObject object = jsonArray.getJSONObject(i);
     String offset = object.getString("offset");
     String value = object.getString("value");
     //rest of the strings..
    }
 }
 catch (JSONException e){
       e.printStackTrace();
}
rafsanahmad007
  • 23,683
  • 6
  • 47
  • 62