Android的解析的JSONObject [英] Android parse JSONObject

查看:200
本文介绍了Android的解析的JSONObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题解析JSON在我的Andr​​oid应用程序。

I've got a little problem with parsing json into my android app.

这是我的JSON文件是这样的:

This is how my json file looks like:

{
"internalName": "jerry91",
"dataVersion": 0,
"name": "Domin91",
"profileIconId": 578,
"revisionId": 0,
}

正如你可以看到这个结构是一个有点怪异。我不知道怎么读我的应用程序的数据。当我发现这些都是对象不是数组:/

As You can see this structure is a little bit weird. I dont know how to read that data in my app. As I noticed those are all Objects not arrays :/

推荐答案

我会用电子书籍<一href="http://google-gson.google$c$c.com/svn/trunk/gson/docs/javadocs/com/google/gson/Gson.html">gson.

I would recomment using gson.

下面是一些链接教程:

  1. 如何从将Java objecto JSON格式使用GSON
  2. 使用GSON
  3. 解析JSON文件
  4. 简单GSON例如
  5. JSON转换为Java
  1. how to convert java objecto from json format using GSON
  2. Parse JSON file using GSON
  3. Simple GSON example
  4. Converting JSON to Java

这是替代以GSON你可以使用 杰克逊

An alternative to gson you could use Jackson

  1. 杰克逊在5分钟内
  2. 如何将Java对象转换为从JSON
  1. Jackson in 5 minutes
  2. how to convert java object to and from json

该库基本分析你的JSON到您指定的Java类。

This Libraries basically parse your JSON to a Java class you specified.

这篇关于Android的解析的JSONObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆