這裏解析是我的JSON對象,我想解析它在Android項目JSON數組中的Android
{
"second": {
"versionInfo": "0.20.3-dev",
"compileDate": "Mon Mar 12 17:39:23 IST 2012",
"compileUser": "suraj",
"trackname": "tracker_localhost:localhost/127.0.0.1:48418"
},
"href": {
"versionInfo": "null",
"compileDate": "null",
"compileUser": "null",
"trackname": "null"
},
"first": {
"key": "['trackname','versionInfo','compileDate','compileUser']"
}
}
如何編譯? 我想先提取'first'的屬性,然後使用屬性,然後使用'first'的屬性提取'second'的參數。
你考慮使用JSON解析器:http://stackoverflow.com/questions/338586/a-better-java-json-library – assylias 2012-03-12 12:43:51
最好的方法是使用Gson並讓它自動爲你做。 – waqaslam 2012-03-12 12:44:20
http://stackoverflow.com/questions/9441932/android-json-error-expected-begin-object-but-was-begin-array-at-line-1-column-2 – 2012-03-12 13:43:43