这是我的json数据
[{"FeedbackId":"1","Phoneid":"9774d56d682e549c","feedbackdate":"2011\/9 \/24","GuestName":"sdf","Address":"sdf","Phone":"456","Email":"sdf","suggestion":"sdf","grievances":"sdf","visitAgain":"0","purposeofvisit":"sdf","flag":"1"},{"FeedbackId":"2","Phoneid":"9774d56d682e549c","feedbackdate":"","GuestName":"sdf","Address":"sdf","Phone":"456","Email":"sdf","suggestion":"sdf","grievances":"sdf","visitAgain":"0","purposeofvisit":"sdf","flag":"1"},{"FeedbackId":"3","Phoneid":"9774d56d682e549c","feedbackdate":"","GuestName":"sdf","Address":"sdf","Phone":"456","Email":"sdf","suggestion":"sdf","grievances":"sdf","visitAgain":"0","purposeofvisit":"sdf","flag":"1"},{"FeedbackId":"4","Phoneid":"9774d56d682e549c","feedbackdate":"2011\/9 \/24","GuestName":"sdf","Address":"dsf","Phone":"456","Email":"sdf","suggestion":"sf","grievances":"sdf","visitAgain":"0","purposeofvisit":"sdf","flag":"1"},{"FeedbackId":"5","Phoneid":"9774d56d682e549c","feedbackdate":"2011\/9 \/24","GuestName":"sdf","Address":"dsf","Phone":"456","Email":"sdf","suggestion":"sf","grievances":"sdf","visitAgain":"0","purposeofvisit":"sdf","flag":"1"},{"FeedbackId":"6","Phoneid":"9774d56d682e549c","feedbackdate":"","GuestName":"xcv","Address":"xcv","Phone":"89","Email":"xcv","suggestion":"xcv","grievances":"xcv","visitAgain":"1","purposeofvisit":"","flag":"1"},{"FeedbackId":"7","Phoneid":"9774d56d682e549c","feedbackdate":"","GuestName":"gfhj","Address":"ghj6678","Phone":"678","Email":"ghjgh","suggestion":"678fgh","grievances":"fgh","visitAgain":"0","purposeofvisit":"sdf","flag":"1"}]
如何解码呢?
您应该能够使用org.json包进行解码。从这里:
String json = "{"
+ " \"query\": \"Pizza\", "
+ " \"locations\": [ 94043, 90210 ] "
+ "}";
JSONObject object = (JSONObject) new JSONTokener(json).nextValue();
String query = object.getString("query");
JSONArray locations = object.getJSONArray("locations");
只需使用自己的JSON即可。
问题内容: 大家好,我正在尝试将JSON值解码到我的Android应用程序中,但是我不确定我的代码在做什么错… 这是我的PHP文件: 它将返回以下内容: [“ 1”,“ Admin”,“ 123”,“ Adm”,“消息”,“ 0”] 在我的Android应用程序中,我需要将该值放入一个数组中,我可以选择分隔的值,但是如何? 这是我的Android代码: 问题答案: 尝试 迫使成为对象。 然后您可以
问题内容: 如何在Flutter中解码JSON? 问题很简单,但答案至少对我来说不是。 我有一个使用大量JSON字符串的项目。基本上,应用程序和服务器之间的整个通信是通过JSON进行的。 我一直在使用它来处理它,但今天我更新了Flutter核心(0.5.8-pre.178),并且JSON.decode不再可用。 我去了Flutter Docs寻求帮助,但仍然说要使用JSON.decode。 那么,
问题内容: 我想读这行,但是因为它以我开始有些困惑 我只需要使用“名称”并将所有另存为一个字符串。(字符串值将是:Jeff Bridges,Charles Grodin,Jessica Lange,John Randolph,Rene Auberjonois)。 这是我的代码: 问题答案: 如果您使用的是“名称”,为什么您的代码片段看起来像是试图获取“字符”的尝试? 无论如何,这与任何其他类似于列
问题内容: json_decode函数不是PHP 5.1的一部分,所以我不能使用它。此版本还有其他功能吗? 问题答案: 在PHP 5.2之前,您可以使用JSON PECL扩展名。 实际上,它是已集成到PHP 5.2 _( 引用 )中_的扩展: 从PHP 5.2.0开始,JSON扩展默认捆绑并编译为PHP。 其他一些解决方案是使用PHP开发的某些组件。 前一段时间(大约一年前),我使用Zend Fr
问题内容: 我想拉出用户块。JSON结果将始终更改,有时将返回4个用户,有时将返回10个,等等。 问题答案: 使用JSONObject
问题内容: 我用python脚本下载了一个网页。在大多数情况下,这可以正常工作。 但是,这个有一个响应标头:GZIP编码,当我尝试打印此网页的源代码时,它的腻子中包含所有符号。 如何将其解码为普通文本? 问题答案: 我使用zlib从Web解压缩压缩的内容。