The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Tasks

One of the most confusing aspects of Android to deal with is the concept of tasks. Fortunately, the automatic management of tasks is almost enough to get by, without you having to do much customization. However, some developers will need to tailor how their app interacts with the task system. Understanding what is possible and how to do it is not easy. It is made even more complicated by changes to Android, from both engineering and design perspectives, over the years.

This chapter will attempt to untie the knot of knowledge surrounding Android’s task system, explaining why things are the way they are. However, there will be a few places where the knot turns a bit Gordian, and we will have to settle for more about “how” and less about “why” the task system works as it does.

Prerequisites

Understanding this chapter requires that you have read the core chapters of this book.

One sample app makes heavy use of the PackageManager system service and refers in a few places to the Launchalot sample app profiled in that chapter.

First, Some Terminology

The preview of this section is in the process of being translated from its native Klingon.

And Now, a Bit About Task Killers

The preview of this section is being chased by zombies.

A Canary for the Task’s Coal Mine

The preview of this section is unavailable right now, but if you leave your name and number at the sound of the tone, it might get back to you (BEEEEEEEEEEEEP!).

The Default User Experience

The preview of this section was traded for a bag of magic beans.

Explaining the Default Behavior

The preview of this section was eaten by a grue.

Basic Scenarios for Changing the Behavior

The preview of this section was lost due to a rupture in the space-time continuum.

Dealing with the Persistent Tasks

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Documents As Tasks

The preview of this section took that left turn at Albuquerque.

Other Task-Related Activity Properties

The preview of this section took that left turn at Albuquerque.

Other Task-Related Activity Methods

The preview of this section took that left turn at Albuquerque.