如何在android中解析嵌套的json数组

时间:2014-10-18 19:07:46

标签: android json

我想解析json数组,如下所示。我需要获得id,category等。

"items":[{
        "id": "s_A7tiCV_XQ",
        "uploaded": "2014-08-30T17:52:42.000Z",
        "updated": "2014-10-17T10:06:04.000Z",
        "uploader": "laharimusic",
        "category": "Music",
        "title": "Aagadu Audio Jukebox || Super Star Mahesh Babu, Tamannaah [HD]",
        "description": "Aagadu Audio Jukebox Subscribe to our Youtube Channel: http://bit.ly/1hE4KpS iTunes : http://goo.gl/SqNCep Buy Your Copy on Flipkart : http://goo.gl/4WGcuN H...",
        "thumbnail":{
            "sqDefault": "https://i.ytimg.com/vi/s_A7tiCV_XQ/default.jpg",
            "hqDefault": "https://i.ytimg.com/vi/s_A7tiCV_XQ/hqdefault.jpg"
        },
        "player":{
            "default": "https://www.youtube.com/watch?v=s_A7tiCV_XQ&feature=youtube_gdata_player",
            "mobile": "https://m.youtube.com/details?v=s_A7tiCV_XQ"
        },
        "content":{
            "5": "https://www.youtube.com/v/s_A7tiCV_XQ?version=3&f=videos&app=youtube_gdata",
            "1": "rtsp://r3---sn-a5m7zu7r.c.youtube.com/CiILENy73wIaGQl0_ZUgtjvwsxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp",
            "6": "rtsp://r3---sn-a5m7zu7r.c.youtube.com/CiILENy73wIaGQl0_ZUgtjvwsxMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"
        },
        "duration": 1594,
        "aspectRatio": "widescreen",
        "rating": 4.201516,
        "likeCount": "2534",
        "ratingCount": 3166,
        "viewCount": 1113129,
        "favoriteCount": 0,
        "commentCount": 610,
        "accessControl":{
            "comment": "allowed",
            "commentVote": "allowed",
            "videoRespond": "moderated",
            "rate": "allowed",
            "embed": "allowed",
            "list": "allowed",
            "autoPlay": "allowed",
            "syndicate": "allowed"
        }
    }

1 个答案:

答案 0 :(得分:2)