• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Parse nested JSON objects/arrays

burton666

Lurker
How can I access the "age" key in the following JSON:

Code:
{
    "images": [
        {
            "status": "Complete",
            "width": 475,
            "height": 475,
            "file": "content_5a28298675c96",
            "faces": [
                {
                    "topLeftX": 109,
                    "topLeftY": 107,
                    "height": 241,
                    "rightEyeCenterY": 167,
                    "rightEyeCenterX": 179,
                    "pitch": -11,
                    "quality": 0.75184,
                    "confidence": 0.99938,
                    "chinTipX": 229,
                    "yaw": -5,
                    "chinTipY": 369,
                    "eyeDistance": 109,
                    "width": 241,
                    "leftEyeCenterY": 167,
                    "leftEyeCenterX": 288,
                    "attributes": {
                        "lips": "Apart",
                        "asian": 0.00006,
                        "gender": {
                            "femaleConfidence": 0.00001,
                            "type": "M",
                            "maleConfidence": 0.99999
                        },
                        "age": 34,
                        "hispanic": 0.00023,
                        "other": 0.00034,
                        "black": 0.99936,
                        "white": 0,
                        "glasses": "Eye"
                    },
                    "face_id": 1,
                    "roll": 1
                }
            ]
        }
    ],
}
 
Back
Top Bottom