我有一个Rest ful服务,..并且我正在获取JSON数据,例如..
{
"returnCode": "success",
"RecievedData": {
"results": [
{
"details": [
{
"moredetails": [{
"id": "123456",
"price": "129.99",
"recorded_at": 3223322,
"lastrecorded_at": 0002020,
"seller": "google",
"availability": "Available",
"currency": "USD"
}],
"offers_count": 1,
"name": "google.com",
"recentoffers_count": 1,
"sid": "988008555566649",
"url": "http://google.com"
},
"moredetails"{
.
.
}
] details
{
{
[
]
}
"model": "abc",
"weight": "127",
"price_currency": "USD",
"features": {
.
'
}
"model": "abc",
"weight": "127",
"price_currency": "USD",
.
.
.
我为此使用this示例或教程
并且它从this url调用json
他在那里正在使用此json对象
jsonarray = jsonobject.getJSONArray("worldpopulation");
解析数据所以我从上面的URL中获取数据如何解析这么多的json数据,因为我只需要2或3个json数组的字段。
请通过上面的示例为工作提供帮助。
最佳答案
您可以使用gson库。有一个例子 here!