如何解析的Android这个JSON数组 [英] How to parse this JSON Array in android
本文介绍了如何解析的Android这个JSON数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要的姓名,电子邮件和图像的每个TAG.I在列表的元素来展现。
I want the name, email and image for each TAG.I have to show in List element.
{
"response":[
{
"name":"Brajendra Mishra",
"email":"test1@seologistics.com",
"address":"Information Service\r\nParliament of Canada\r\nOttawa, Ontario K1A 0A9",
"aboutus":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ",
"image":"http:\/\/74.52.209.213\/lab\/event\/img\/attachments\/photos\/small\/4f2a5a71-acc0-4319-b1ca-14774a34d1d5.jpg"
},
{
"name":"Toney Grey",
"email":"test2@seologistics.com",
"address":"Information Service\r\nParliament of Canada\r\nOttawa, Ontario K1A 0A9",
"aboutus":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. ",
"image":"http:\/\/74.52.209.213\/lab\/event\/img\/attachments\/photos\/small\/4f1d4283-5204-4f16-90d6-69924a34d1d5.jpg"
}
],
"count":2
}
我尝试了很多,但没能做到。
I tried a lot but not able to do.
只要让我知道的循环,如何到达值为每个姓名,电子邮件,图像等,如何把握。
Just let me know the Loops, how to reach the values for each name, email, image etc, how to hold.
推荐答案
我生成UR ussue的解决方案。
I generate a solution for ur ussue.
JSONArray jObject = new JSONArray(jsoninputstring);
for (int i = 0; i < jObject.length(); i++,start++) {
JSONObject menuObject = jObject.getJSONObject(i);
String name= menuObject.getString("name");
String email= menuObject.getString("email");
String image= menuObject.getString("image");
}
这篇关于如何解析的Android这个JSON数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文