我已经尝试了很多样品和有关GSON和教程的东西怎么会使用它,例如工作:
http://www.softwarepassion.com/android-series-parsing-json-data-with-gson/
http://androidsmith.com/2011/07/using-gson-to-parse-json-on-android/
等等。
我的问题是,我有我的返回此JSON值http://localhost:3000/users/1.json
,那就是:
{
"created_at": "2012-09-20T01:43:15Z",
"id": 1,
"name": "kevin",
"updated_at": "2012-09-20T01:43:15Z"
}
另一个是在该URL http://localhost:3000/users.json
具有JSON值
[ {
"created_at": "2012-09-20T01:43:15Z",
"id": 1,
"name": "kevin",
"updated_at": "2012-09-20T01:43:15Z"
}, {
"created_at": "2012-09-20T01:43:33Z",
"id": 2,
"name": "pineda",
"updated_at": "2012-09-20T01:43:33Z"
}, {
"created_at": "2012-09-20T01:46:08Z",
"id": 3,
"name": "raphael",
"updated_at": "2012-09-20T01:46:08Z"
}, {
"created_at": "2012-09-20T16:13:42Z",
"id": 4,
"name": null,
"updated_at": "2012-09-20T16:13:42Z"
}, {
"created_at": "2012-09-20T16:18:03Z",
"id": 5,
"name": null,
"updated_at": "2012-09-20T16:18:03Z"
}, {
"created_at": "2012-09-20T16:19:23Z",
"id": 6,
"name": null,
"updated_at": "2012-09-20T16:19:23Z"
}, {
"created_at": "2012-09-20T16:20:41Z",
"id": 7,
"name": null,
"updated_at": "2012-09-20T16:20:41Z"
}
]
我有一点很难解析这些数据和得到它存储的目的。