So i have a listview with 10 rows, for each row i have to load a image thumbnail from different url's, is there a way to do this with out downloading all 10 big images and resizing them, i just need the thumbnails from those pictures, and downloading all pictures will take a lot of time and memory, any ideas ? =\
Thanks a lot for all of your answers,开发者_如何学Go great ideas.
You have not much choices:
You have local copies of the images in your app resource
You need to load the images, scale them yourself cache tem and update your listview when you did that
To decrease amount of traffic and memory use you could prescale those pictures, provide those thumbnails besides the original picture, and request that first
(I don't think that there is something like that for free, but would be great) Use a web API which rescales the picture and returns the thumbnails. This would reduce the traffic but probably not the request time. (Maybe setup a private web service which does that for you, maybe php)
1, u can download those images then create a thumbnail from that bitmaps, then store it in SD card saved_thumbs
2, on the server side u can create the thumbs with php, then download that images
Here's what you need to do:
- Download the images to a Bitmap.
- get access to your applications cache and write the bitmaps to the cache.
- Each time the activity is brought into view check the cache for the images, if they are there get them from cache. if not download them.
These are the steps you need to take. Let me know if you have any questions or problems.
精彩评论