【发布时间】:2015-07-23 10:49:15
【问题描述】:
我是第一次在 android 中开发,我以前从未使用过 json 数据。我将开发我大学的活动日历的应用程序。我们在 Django 中开发了 web 版本的应用程序,我们实现了 sweetpie (restapi),所以我需要将此 json 数据用于 android 移动版本。我的 json 数据是这样的:
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 5
},
"objects": [{
"Location": "Z011",
"Notes": "asdf",
"Title": "Literature Talking",
"id": 3,
"resource_uri": "/api/v1/Events/3/"
}, {
"Location": "Batı Kampüsü, Sinema Salonua",
"Notes": "sd",
"Title": "TARİHÇE KONFERANSLARI SERİSİ 25",
"id": 4,
"resource_uri": "/api/v1/Events/4/"
}, {
"Location": "in Campus",
"Notes": "afafdf",
"Title": "Self-Assessment Project",
"id": 5,
"resource_uri": "/api/v1/Events/5/"
}, {
"Location": "Kütüphane",
"Notes": "fs",
"Title": "51.Kütüphane Haftası",
"id": 6,
"resource_uri": "/api/v1/Events/6/"
}]
}
如何在 android studio 中解析这个 Json 数据?
【问题讨论】:
-
一个很好用的库是谷歌自己的:Gson。看看吧!