O'Reilly logo

The Android™ Developer’s Cookbook: Building Applications with the Android SDK, Second Edition by Nelson To, Ronan Schwarz, James Steele, Phil Dutson

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

3. Threads, Services, Receivers, and Alerts

This chapter continues the introduction of the basic building blocks of an application. First, the explicit specification of threads is introduced as a method to separate tasks. Then, services and broadcast receivers are introduced. As shown in some recipes, services and broadcast receivers benefit from using threads. The application widget, which uses receivers, is then covered. This leads naturally to the discussion of various alerts available to the developer.

Threads

Every application by default runs a single process upon creation that contains all the tasks. To avoid hanging the user interface, time-consuming tasks, such as network downloads or computationally intensive calculations, should reside ...

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