Android ListView with lots of same drawables performance -


i'm developing android app list view contains lots of drawables. of them same i'm trying use hashmap returns same allocated bitmap when it's needed still there lots of allocations , gc actions list gets stuck time time when scrolling.

what can optimize performance in such case?

caching method - loadimage using google code

mimageworker.loadimage(pic_url, holder.pic); holder.*some bitmap*.setimagebitmap(utility.getbitmap(context, id); //can 1 of 5 bitmaps use caching hashmap 

try use lazy loading technique using caching, can find many tutorial on web:

you have see thread

also see this:

multithreading performance, tutorial gilles debunne.

this android developers blog. suggested code uses:

  1. asynctasks.
  2. a hard, limited size, fifo cache.
  3. a soft, garbage collected cache.
  4. a placeholder drawable while download.

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -