-2

可能重复:
如何在 Android 中解析这个 JSON?

我有一个要求,我需要解析 jsonObject。我的格式将是

[{"music":{"artist":"Dire Straits","album":"The Best of Dire Straits","genre":"Pop","title":"Sultans Of Swing"}},{"camera":{"picture":"http:\/\/sp.sony-europe.com\/da\/594\/195346.jpeg","model":"Digital Still Camera - H Series - DSC-HX200V","make":"Sony","price":510}},{"book":{"description":"What is self, and how can a self come out of inanimate matter?' Is the riddle that drove Douglas Hofstadter to write this extraordinary book. In order to impart his highly original and personal view on the core mystery of human existence - the intangible sensation of 'I'-ness - Hofstadter defines the playful yet seemingly paradoxical notion of 'strange loop', and explicates this idea using analogies from many disciplines.","authors":"Douglas R Hofstadter","price":650,"id":40724766,"title":"G\u00f6del, Escher, Bach: an Eternal Golden Braid"}}]

如何解析这个?帮我?

4

2 回答 2

1

谷歌:Android 解析 json

第一个教程命中:这里

于 2012-08-08T20:45:19.563 回答
0

您可以使用GSON(或)json-lib等 JSON 库之一来解析 JSON 字符串。他们为 json 字符串创建 Java 对象。

于 2012-08-08T20:45:50.437 回答