January 2017
Beginner to intermediate
624 pages
22h 42m
English
In this chapter, you saw how to use AlarmManager, an IntentService, and PendingIntents to put together a periodically executing background task. In doing that, you had to do a few things manually:
schedule a periodic task
check whether that periodic task was currently running
check whether the network was currently up
You had to stitch a few different APIs together by hand to create one functioning background worker that you could start and stop. It worked, but it was a lot of work.
In Android Lollipop (API 21), a new API was introduced called JobScheduler that can implement these kinds of tasks on its own. It is also capable of more: For example, it can avoid starting ...
Read now
Unlock full access