【问题标题】:how to parse the jsonObject in android? [duplicate]如何解析android中的jsonObject? [复制]
【发布时间】:2012-08-09 18:46:40
【问题描述】:

可能重复:
How can I parse this JSON in Android?

我有一个需求,我需要解析 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"}}]

如何解析这个?帮帮我?

【问题讨论】:

  • 其实不是jsonObject,而是jsonArray

标签: java android json


【解决方案1】:

Google: Android parse json

第一个教程点击:here

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-13
      • 1970-01-01
      • 2015-07-05
      • 2014-11-22
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多