需要关于android Json Parsing的帮助

时间:2022-08-26 11:24:05

Friend's I need to parse and list the data from web service response as json array,i can able to parse and list the response with simple format like Sting jsonStr = "[{\"id\":101,\"date\":\"Wed, 29 Dec 2010 11:55:00 GMT\"}]"; by using json parser...

朋友我需要解析并将来自Web服务响应的数据列为json数组,我能够解析并列出响应的简单格式,如Sting jsonStr =“[{\”id \“:101,\”date \“: “2010年12月29日星期三11:55:00 GMT \”}]“;通过使用json解析器...

JSONArray jArray = new JSONArray(jsonStr);
            for(int i=0;i<jArray.length();i++){
               JSONObject json_data = jArray.getJSONObject(i);
               id = json_data.getString("id");
}

but i need help on parsing the format given below [{"DealUser":{"id":"3","created":"2011-01-13 17:40:34"}, "User"{"usertype_id" : "2","username" : "fsp"}, "Deal"{"id":"122","price":"$34"}];

但我需要帮助解析下面给出的格式[{“DealUser”:{“id”:“3”,“created”:“2011-01-13 17:40:34”},“User”{“usertype_id” :“2”,“username”:“fsp”},“Deal”{“id”:“122”,“price”:“$ 34”}];

here i need to parse the three json tags like DealUser,User,Deal and add to list to set on listview. Help me to parse the above string data to add on list.

在这里,我需要解析三个json标签,如DealUser,User,Deal和add to list to listview。帮我解析上面的字符串数据以添加到列表中。

Thanks in advance.

提前致谢。

1 个解决方案

#1


1  

You can get idea from this link

你可以从这个链接中获得想法

Link

#1


1  

You can get idea from this link

你可以从这个链接中获得想法

Link