From the course: Concurrent Programming with Android: Threads, Workers, and Kotlin Coroutines

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Upgrade IntentService to JobIntentService

Upgrade IntentService to JobIntentService

- I previously described how to use intent service to manage a long running task in its own thread. But that class is being deprecated in Android R or 11. Instead, Google recommends using a newer class named job intent service. Before I get into the coding, here's a bit of background. In API 21, that's Android eight or Oreo. Android introduced a new tool named JobScheduler for scheduling various kinds of jobs that could be executed in an app's own process. Significantly. Jobs scheduled with this tool are deferrable. If a device is dozing, or it's too busy, jobs can be delayed until the appropriate resources become available. The downside of JobScheduler is that it's part of the core Android SDK, and isn't back ported to older versions of Android. But if you want the advantages of Job Scheduler, but the ease of programming offered by intense service, you can instead use the newer class Job intent service. This class does…

Contents