开发者

json parsing in android of web data

I have to par开发者_运维知识库se this json data. The data begins with [ and ends with ]

How can we parse such json data? json data usually starts with {..[..]..}


Just create a JSONArray from your input. There is even a constructor taking a String as parameter. So, basicly you need to do something like this:

String input = .. //read your input
JSONArray arr = new JSONArray(input);
//work with the array as usual..


take result data as a JSONArray and not a JSONObject.


It depends on how you parse the data. Built in json or google json(gson) etc. But normally you dont have to care about that it starts with square bracket. Show me what the json array/object look like and I can give you an example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜