I have been trying several ways of displaying my json images but my solutions never succeded.
I have parsed my json and I'm getting the response.
However included the respose is an image which I need to display in my app.
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?
![Parsed images][1]
Thanks in advance
below 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");
}
}
Many thanks
Try that my friend :) Parse your json and take the URL and then put them us URL in the method https://asantoso.wordpress.com/2008/03/07/download-and-view-image-from-the-web/
The jSON doesn't actually contain the images, it contains links to the image. If you feed those URLs into a WebView or Browser, you will see the images.
try this:
this will draw the image into the webview. You can define your webview in xml or programatically as I did above.