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.

PowerManager and WakeLocks

There are going to be times when you want the device to keep running, even though it ordinarily would go into a sleep mode, with the CPU powered down and the screen turned off. Sometimes, that will be based upon user interactions, or the lack thereof, such as keeping the screen on while playing back a video. Sometimes, that will be to allow background scheduled work to run to completion, as was introduced in the chapter on AlarmManager.

This chapter looks a bit more at the details of this sort of power management, including coverage of how AlarmManager works.


Understanding this chapter requires that you have read the core chapters, particularly the chapter on AlarmManager.

Keeping the Screen On, UI-Style

The preview of this section is [REDACTED].

The Role of the WakeLock

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

What WakefulIntentService Does

The preview of this section is sleeping in.