Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Android ListView: How to Make it Efficient

DZone's Guide to

Android ListView: How to Make it Efficient

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

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.


Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}