Zeus
Zeus

Reputation: 6586

Android listview load images only when the list items are shown

My android application has to show thumbnails of the audio file album art for each and every song. The mobile i'm testing on has about 2000 songs, so, I need to optimize the performance. There is a lot of lag if I use adapter's getview to load thumbnails.

So, to make it asynchronous I've added thread to load images, but it turns out 2000 threads are created to load all 2000 thumbnails.

Is there a way to optimize this? like lazy loading or live scrolling in android?

Update: Also, I'd like to get rid of the image thumb nails from the memory when scrolling as the number of images can cause OutOfMemory error.

Thanks.

Upvotes: 0

Views: 167

Answers (1)

KOTIOS
KOTIOS

Reputation: 11194

This is lib u can use for lazy loading : Lib

  1. Will optimize ur thumbnail performance.

  2. Scroll listview smoothly

  3. u can run this lib in android and watch the performance.

Upvotes: 1

Related Questions