Android的解析的JSONObject [英] Android parse JSONObject
本文介绍了Android的解析的JSONObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个小问题解析JSON在我的Android应用程序。
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.
下面是一些链接教程:
- how to convert java objecto from json format using GSON
- Parse JSON file using GSON
- Simple GSON example
- Converting JSON to Java
这是替代以GSON你可以使用 杰克逊
An alternative to gson you could use Jackson
- Jackson in 5 minutes
- 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屋!
查看全文