开发者

Image thumbnail from web for a listview

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:

  1. You have local copies of the images in your app resource

  2. You need to load the images, scale them yourself cache tem and update your listview when you did that

  3. To decrease amount of traffic and memory use you could prescale those pictures, provide those thumbnails besides the original picture, and request that first

  4. (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:

  1. Download the images to a Bitmap.
  2. get access to your applications cache and write the bitmaps to the cache.
  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜