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


WorkManager

Hardly a year goes by anymore without some new solution for doing background work becoming available for Android developers. In some cases, the new solution is designed to make things easier. In some cases, the new solution is designed to work around platform-imposed limitations (a.k.a., “The War on Background Processing”).

The solution introduced in 2018 was WorkManager, and preliminary indications are that it will be Google’s “go-to” solution for many background work scenarios.

WorkManager is considered to be part of the Architecture Components, despite having only loose connections to the rest of the Components. WorkManager does offer ways to monitor work via LiveData, for cases where the work happens to be going on while your UI is still visible.

In this chapter, we will explore WorkManager, its role, and how to employ it.

NOTE: At the time of this writing, WorkManager is in a beta state.

Where Should We Use WorkManager?

WorkManager is designed for “deferrable” work — work that you need to have done but does not have to happen right away. This includes the possibility that the work will be done sometime after your current process has terminated.

In this respect, WorkManager behaves akin to JobScheduler, which is the main engine behind WorkManager for API Level 23+ devices.

Where Should We Not Use WorkManager?

The preview of this section is [REDACTED].

WorkManager Dependencies

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

Workers: They Do Work

The preview of this section apparently resembled a Pokémon.

Performing Simple Work

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!).

Work Inputs

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

Constrained Work

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

Tagged Work

The preview of this section was lost in the sofa cushions.

Monitoring Work

The preview of this section was fed to a gremlin, after midnight.

Canceling Work

The preview of this section is off trying to sweet-talk the Khaleesi into providing us with a dragon.

Delayed Work

The preview of this section will not appear here for a while, due to a time machine mishap.

Parallel Work

The preview of this section was eaten by a grue.

Chained Work

The preview of this section left for Hollywood to appear in a reality TV show.

Periodic Work

The preview of this section was whisked away by a shark-infested tornado.

Unique Work

The preview of this section is presently indisposed.

Testing Work

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

WorkManager and Side Effects

The preview of this section may contain nuts.