July 2015
Beginner to intermediate
600 pages
18h 59m
English
In this chapter, you saw how to use AlarmManager, an IntentService, and PendingIntents to stitch 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 is currently running
check whether the network is currently up
You might want to do more than that in the real world. For example, you might want to implement a backoff-and-retry policy if your request fails, or restrict network access to unmetered Internet access. What if you wanted to only check for new photos while the device was charging? These things are certainly possible, but they are not easy or obvious.
On top ...
Read now
Unlock full access