How to get image from MySQL DB using PHP & Json and show it in Android Grid view or image view
How to get the image from DB . I tried to generate JSON data using PHP from MySQl but it showing like this for the image "Image_Poster":null, rest of primitive types are am getting the fine output as JSON but Dono how to fix it for image ......
Can any one help for this
Thanks in Advance
Asked
Active
Viewed 870 times
1

user3251646
- 278
- 4
- 15
-
1To add image in json file there are two options. Either give the image link or convert the image data in base64 format and then send it through json. – if-else-switch Jun 24 '14 at 04:41
-
How are you storing *said* image in the database? – Darren Jun 24 '14 at 04:43
-
Storing Image as BLOB in DB @Darren – user3251646 Jun 24 '14 at 05:25
-
@sam:in DB under what datatype want to store the Image LINK (URL) in String or else any other type – user3251646 Jun 24 '14 at 05:27
-
Simply you can use TEXT type – if-else-switch Jun 24 '14 at 05:40
-
[**This might be able to shed some light**](http://stackoverflow.com/questions/4855447/how-to-use-blob-with-json-and-php) – Darren Jun 24 '14 at 05:40
-
@sam:no need to use base64 conversion for image link right??? – user3251646 Jun 24 '14 at 05:45
-
Yes. Now its simple string. Just add in your JSON – if-else-switch Jun 24 '14 at 06:02
-
@sam :got url in JSON output ..Now How to parse it in Android? – user3251646 Jun 24 '14 at 06:12
-
Extract that url string from JSON and call the url to get bitmap image. After getting bitmap image just setBitmap image in the image view. – if-else-switch Jun 24 '14 at 06:15
-
@sam:Any reference tutorial – user3251646 Jun 24 '14 at 06:27
-
Definitely. Go through it http://stackoverflow.com/a/5776903/3432566 – if-else-switch Jun 24 '14 at 06:59
-
@sam:thank you it will work for single image ....what to do for more than one image ?? – user3251646 Jun 24 '14 at 07:27