Skip to content Skip to sidebar Skip to footer

Extract Jsonobject Inbetween Another Jsonobject

I want to extract the data from JSON data which I have received from an API. I know how to retrieve simple jsonArray data or a JsonObject from Jsonarray, but I'm new to JSON nestin

Solution 1:

If I read that JSON correctly...

1) Get the call log 2) Get the numbers 3) Get the entries for that number 4) Get values from that entry

JSONObject responseObject = newJSONObject(response);
JSONObject callLog = responseObject.getJSONObject("call_log"); // 1Iterator<String> phoneNumbers = callLog.keys(); // 2while( phoneNumbers.hasNext() ) {
    JSONObject numberLog = callLog.getJSONObject(phoneNumbers.next());
    Iterator<String> callEntries = numberLog.keys(); // 3while( callEntries.hasNext() ) {
        JSONObject entry = numberLog.getJSONObject(callEntries.next());

        // 4String name = entry.getString("start_date");

Post a Comment for "Extract Jsonobject Inbetween Another Jsonobject"