最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

JSON解析器的Andr​​oid

SEO心得admin42浏览0评论
本文介绍了JSON解析器的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 JSONObject jObject = new JSONObject(myJsonContent); JSONObject menuObject = jObject.getJSONObject(String.valueOf(jObject.keys().next()));

myJsonContent是从服务器响应,我不知道什么是开始标记......和我不想知道...

myJsonContent is response from server and i dont know what is start tag ... and i dont want to know even...

,之后不知道我要来解析响应响应任何标记。

and after that without knowing any tag of response i want to parse response..

这是因为需求量的在未来,我们将不知道,如果服务器人员更改数据和标签以及因此我们需要建立这样,这将是工作即使服务器家伙改变未来所有的标签

this is requirment because in the future we will not be knowing if server guys change data and tags as well so we need to create like this which will be work even if server guys changes all the tags in future

请帮我任何形式的帮助是非常appriciable

please help me any kind of help is very appriciable

推荐答案

您应该检查在这里,

developer.android/reference/org/json/ JSONObject.html

得到JSON对象即iterator和循环彻底其键和使用jsonObject.names()来获取名称的数组。这应该引导您正确的解决方案。

get keys from json object i.e. iterator and loop thorough it and use jsonObject.names() to get the array of names. This should guide you to the right solution.

发布评论

评论列表(0)

  1. 暂无评论