hi here is my webservice code [{"video_id":"119","user_id":"127","video_poster":"http://demo.cogzideltemplates.com/client/sedio/images/527901be41dfb91eea7e7825baee262f.jpg","fullname":"testacc268","channel":"Family", "title":"Fffffgffffgg","video_name":"http://demo.cogzideltemplates.com/client/sedio/video/d2b6a230106f355d2eee796863f4088a.mp4","status":"1","total_like":"1", "total_vine":"1","video_created_date":"1 w","followers":"1", "following":"0","post_private":"0","post_sensitive":"0", "profile_image":"http://pbs.twimg.com/profile_images/489273121241722880/kGCUNK2Y_bigger.jpeg","user_like":"Unlike","user_vine":"Vine","location":""},{"video_id":"118","user_id":"127","video_poster":"http://demo.cogzideltemplates.com/client/sedio/images/1ae825f39d90f209cb593a916ac9a048.jpg","fullname":"testacc268","channel":"", "title":"Fhgdfg","video_name":"http://demo.cogzideltemplates.com/client/sedio/video/78105faebb9dfe0cf67b60ada04aca03.mp4","status":"1","total_like":"0", "total_vine":"0","video_created_date":"1 w","followers":"1", "following":"0","post_private":"0","post_sensitive":"0", "profile_image":"http://pbs.twimg.com/profile_images/489273121241722880/kGCUNK2Y_bigger.jpeg","user_like":"Unlike","user_vine":"Unvine","location":""},{"video_id":"117","user_id":"127","video_poster":"http://demo.cogzideltemplates.com/client/sedio/images/131968331051b1173f913029f738efed.jpg","fullname":"testacc268","channel":"Dogs", "title":"Fhjvg","video_name":"http://demo.cogzideltemplates.com/client/sedio/video/2ec8bfcd0cd960b0f3e079ca503fba5c.mp4","status":"1","total_like":"0", "total_vine":"0","video_created_date":"1 w","followers":"1", "following":"0","post_private":"0","post_sensitive":"0", "profile_image":"http://pbs.twimg.com/profile_images/489273121241722880/kGCUNK2Y_bigger.jpeg","user_like":"Unlike","user_vine":"Unvine","location":""},{"video_id":"116","user_id":"127","video_poster":"http://demo.cogzideltemplates.com/client/sedio/images/131968331051b1173f913029f738efed.jpg","fullname":"testacc268","channel":"Dogs", "title":"Fhjvg","video_name":"http://demo.cogzideltemplates.com/client/sedio/video/2ec8bfcd0cd960b0f3e079ca503fba5c.mp4","status":"1","total_like":"1", "total_vine":"0","video_created_date":"1 w","followers":"1", "following":"0","post_private":"0","post_sensitive":"0", "profile_image":"http://pbs.twimg.com/profile_images/489273121241722880/kGCUNK2Y_bigger.jpeg","user_like":"Like","user_vine":"Unvine","location":""},{"video_id":"115","user_id":"127","video_poster":"http://demo.cogzideltemplates.com/client/sedio/images/982da2c7d7aa7fc4385266ccad6f0fb1.jpg","fullname":"testacc268","channel":"Dogs", "title":"pppppppppppppppppppppppppp","video_name":"http://demo.cogzideltemplates.com/client/sedio/video/d7a5291b8871fa3b2d3364abefc0c074.mp4","status":"1","total_like":"1", "total_vine":"0","video_created_date":"1 w","followers":"1", "following":"0","post_private":"0","post_sensitive":"0", "profile_image":"http://pbs.twimg.com/profile_images/489273121241722880/kGCUNK2Y_bigger.jpeg","user_like":"Like","user_vine":"Unvine","location":""} ]
如何在Android上显示它?
答案 0 :(得分:0)
以下是一个示例代码,显示您必须从响应中检索数据,从您要显示的所有或必填字段执行相同操作。
public void readingJson(String jsonString) {
try {
JSONArray jsonArray = new JSONArray(jsonString);
for(int i = 0 ; i<jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
String imgUrl = jsonObject.getString("video_poster");
Log.e(TAG, "imgUrl = " + imgUrl);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}