我怎样才能显示此图像JSON [英] How can I display this json image
问题描述
我一直在试图显示的json图像的几种方法,但我从来没有解决succeded。
I have been trying several ways of displaying my json images but my solutions never succeded.
我分析我的JSON和我得到的响应。
I have parsed my json and I'm getting the response.
不过包括respose是我需要在我的应用程序来显示图像。
However included the respose is an image which I need to display in my app.
Recieving的形象:HTTP://media.rightmove.co.uk/31k/30471/29462938/30471_FLE100159_IMG_00_0002_max_200x1 38.jpg,这仅仅是string.I我的数据库中有这些以下图片
Recieving the image as :"http: //media.rightmove.co.uk/31k/30471/29462938/30471_FLE100159_IMG_00_0002_max_200x138.jpg" which is just string.I have these below images in my database.
我怎么能在我的应用程序中显示这些图像?
How can I display these image in my app?
![解析的图像] [1]
![Parsed images][1]
在此先感谢
低于code。
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
JSONParser prop = new JSONParser();
JSONObject json = prop.getJSONFromUrl(url);
try{
properties = json.getJSONArray(TAG_PROPERTY);
for (int i = 0; i < properties.length(); i++) {
JSONObject c = properties.getJSONObject(i);
String photoThumbnailUrl = c.getString(TAG_PHOTOS);
// load image view control
imgView = (ImageView) findViewById(R.id.imgView);
// grab image to display
try {
imgView.setImageDrawable(grabImageFromUrl(photoThumbnailUrl));
} catch (Exception e) {
txtUrl.setText("Error: image not grabed");
}
}
}catch (Exception ex) {
txtUrl.setText("Error: Properties not recieved");
}
}
非常感谢
推荐答案
尝试,我的朋友:)
解析您的JSON和采取的URL,然后把它们放在我们网址的方法
的https://asantoso.word$p$pss.com/2008/03/07/download-and-view-image-from-the-web/
这篇关于我怎样才能显示此图像JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!