Mobile Zone is brought to you in partnership with:

Alec is a Content Curator at DZone and lives in Raleigh, North Carolina. He is interested in Java and Android programming, and databases of all types. When he's not writing for the NoSQL and IoT Zones, you might find him playing bass guitar, writing short stories where nothing happens, or making stuff in Java. Alec is a DZone Zone Leader and has posted 543 posts at DZone. You can read more from them at their website. View Full User Profile

Android ListView: How to Make it Efficient

12.11.2013
| 5689 views |
  • submit to reddit

This post from Nick Bradbury tackles an issue familiar to every Android developer: the ListView. In particular, Bradbury aims to help readers make their ListView scroll more smoothly, or as he puts it, "un-jank" them. He breaks the process down into four steps:

  1. Use the View Holder pattern
  2. Do as little work as possible in getView()
  3. Reduce unnecessary overdraw
  4. Flatten the view hierarchy

Rather than focusing on the ViewHolder pattern, which he takes as a given that most developers are probably already familiar with, Bradbury addresses other lesser-known issues (steps 2 through 4) that impact the performance of ListView scrolling.

For a few tips on cleaning up your ListView, check out Bradbury's full article. Or, for a more detailed, step-by-step tutorial, check out Antoine Merle's two-part series on ListView Optimizations here and here.