O'Reilly logo

Android™ Concurrency by G. Blake Meike

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Looper/Handler

The ants go marching one by one. Hurrah! Hurrah!

Children’s song

Although AsyncTasks are the first concurrency construct that most developers encounter when they start working with Android, they are not its central concurrency construct. The basic concurrency construct in Android is the Looper/Handler.

Introducing the Looper/Handler

The Looper/Handler framework, like several other important parts of Android’s internal architecture, was probably inspired by the BeOS operating system—in particular, its BLooper and BHandler classes.

The Looper framework is an extension of the safe publication idiom, introduced Chapter 2, “Java Concurrency,” and shown again in Figure 5.1. The idiom consists of a drop box and a lock on that drop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required