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

7. Periodic Tasks

The great enemy of communication, we find, is the illusion of it.

William H. Whyte

One of the most important varieties of asynchronous task is a task that must repeat on a schedule. Scheduled tasks usually synchronize the state of the application that contains them with some external state. Of course, whenever possible, it is better if the external state pushes change notification to the application: push notifications don’t have granularity lag and scale better than polling.

Sometime, however, polling and explicit scheduling are necessary. An application that depends on a resource that doesn’t send push notifications is going to have to poll that resource. Alternatively, sometimes conditions local to the device drive explicit ...

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