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

时间:2014-07-21 11:25:36

标签: android json nested

如何获取纬度和经度对象。请帮忙

{

"category":[
    {
        "name":"Judging_Point",
        "title":"",
        "iconimg":"33.png",
        "count":0,
        "content":""
    },
    {
        "name":"Street_Trading_Stalls",
        "title":"Street Trading Stalls",
        "iconimg":"34.png",
        "count":0,
        "content":""
    },
    {
        "name":"static_sound_systems",
        "title":"Sound Systems",
        "count":29,
        "iconimg":"24.png",
        "content":[
            {
                "latitude":"51.52603767293402",
                "longitude":" -0.2136941301305184",
                "title":"4 Play",

},  {                     “纬度”:“51.52603767293402”                     “经度”:“ - 0.2136941301305184”,                     “title”:“4 Play”, },

2 个答案:

答案 0 :(得分:0)

一个选项是使用JSONSimple和Java JSON lib。 Android可能包含一个json lib,但我喜欢简单的json,因为它很简单:)

只需创建一个Parser对象并读取String。

然后通过获取"类别"创建一个JSONObject。等等

答案 1 :(得分:-1)

@ user3796430尝试集成GSON库。它肯定会帮助你...