Background work on Android can be challenging when you have to support a wide range of API levels. Specifically you can use Alarm Manager, Job Scheduler or GCM Network Manager depending on your minimum API level and if the device has Play Services. To help abstract away which implementation you’re using to perform background work, the good folks at Evernote have open-sourced, Android Job.
Android Job works by first allowing you to define how you want your jobs to be created, by means of the Job Creator class. Then you can schedule requests using the Job Manager and have the confidence that they will be run when the requirements are met. In the image below you can see a representation of the various components involved with using Android Job in your application. Each Job is identified by a tag; this is just a simple String that is used to differentiate the various jobs in your application.
Let’s take a look at each piece!
Continue Reading