Droidcon 2012: Lazy loading in lists
by Droidcon Berlin on Mar 19, 2012
- 2,937 views
There is nearly no app not using a ListView, either to show a long list of items that would not fit on a single screen, or to display information that was downloaded from a backend and does not have a ...
There is nearly no app not using a ListView, either to show a long list of items that would not fit on a single screen, or to display information that was downloaded from a backend and does not have a fixed, or known item count. To enable a ListView to contain an unlimited number of items, the contained views have to be created on the fly while the user scrolls through the list. A list that fails the expectations of the user in scrolling speed and smoothness tends to appear broken and let users turn away from an app. Since all network, or persistent memory calls slow down the item creation all work that will cause a ListView to stutter has to be moved to a background thread. If new information is available, or an image is loaded the list has to be updated. All this needs to happen without consuming to much resources and without noticeable interruptions for the user. This process is not trivial in Android and many examples as well as tutorials available in the Internet still show wrong solutions for this task. This talk will show the best known way to lazy load images, from the network and the file system, into a ListView and how to avoid the pitfalls of the Android ListView-API that cause a bad user experience in a lot of current Android Applications. After outlining a solution for the standard case the speaker will try to answer as much questions about specific ListView problems as possible in an extensive Q&A part.
- Total Views
- Views on SlideShare
- Embed Views