本文介绍了如何从一个网址到Android设备解析只有一些选定的Json数组和JSON对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JSON数据和一个包含多个JSON阵列和JSON对象,所以我想分析其中的一些在Android活动,...

JSON数组和JSON的实例对象在这里 , JSONReader是要走的路。

I have a Json data and which contains multiple JSON arrays and JSON Objects so i want to parse some of them in an android activity ,...

Example of JSON array and Json objects at here

So i want to call some of them in the android device....i know how to parse but i want only some of contents ,..

I have the data like

 {
   "process":"done"
    "one":1
   "List": {
    "Something": [
        {
            "Name": "John",
            "phone": "test"
        }
    ]
     "details":"ok"
     "two":2 
    "SomethingElse": [
        {
            "Name": "Smith",
            "phone": "test"
        }
    ]
   }
  }

Like that i have a Restful service and it has lot of data ,.. so if want to call "list" or "SomethingElse" jsonObjecs/arrays.... its not calling its strucking at starting,..

解决方案

You could consider parsing your data the SAX way, just go through your nodes, if it's what you need parse it, otherwise skip it and go on. Have a look here, JSONReader is the way to go.

这篇关于如何从一个网址到Android设备解析只有一些选定的Json数组和JSON对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 06:50