I have an app that download some images from a server. Now app create a http post request for php script, that retrieve image (4 for each request) and sent it to my app into a json response (encoded in base 64). I put images into a ScrollView, and when user reach the end of the list, a new group of images is downloaded. That is not the most perfotmant way, so i would use some LazyLoad libraries found on gitHub, but all of that require link to image, but i wouldn't sent in any way image link to app. So, how can i do to retrieve images with lazy load?
Asked
Active
Viewed 126 times
1
-
So do you want to cache those image in your device??? – Kishan Dhamat Sep 23 '14 at 08:34
-
check this http://stackoverflow.com/a/8562313/1761003 – Maveňツ Sep 23 '14 at 08:37
-
@Kishan yes, i would cache images into my device until current activity is running – giozh Sep 23 '14 at 08:44
-
@maven i've see that library, but in require link of image – giozh Sep 23 '14 at 08:45
-
here it is https://github.com/nostra13/Android-Universal-Image-Loader/blob/master/sample/src/com/nostra13/universalimageloader/sample/Constants.java – Maveňツ Sep 23 '14 at 08:47
-
my app shouldn't know links of images. Images are results of a query on database – giozh Sep 23 '14 at 08:48
-
`i would cache images into my device until current activity is running ` ??? Don't understand this. Please elaborate. – greenapps Sep 23 '14 at 09:39
1 Answers
0
Requesting images one by one or four by four does not make such a difference. In both cases you would first put a placeholder image in the imageview(s) and upon download complete and extracting done put the images in the respective imageviews if they do still exist. I suppose you put the downloaded and extracted images on the device so you can use them again when the user scrolls or starts the app again?

greenapps
- 11,154
- 2
- 16
- 19
-
it's how my app current works. But app don't receive any link to images, but a json message with encoded images. So if i want to use lazy load library i needs to use links? – giozh Sep 23 '14 at 10:35
-
Yes I understood that of course. You are not telling anything new. So why didn't you react more to the point? You do not need links to images. A link to a four image file/response is ok. Have you ever implemented a lazy image loader with image links? – greenapps Sep 23 '14 at 10:38