Android JobIntentService is deprecated

Viewed 9373

The JobIntentService class appears to be deprecated. Yet the Android documentation for services says: "You can use JobIntentService as a replacement for IntentService that is compatible with newer versions of Android."

So what are we supposed to replace JobIntentService with?

1 Answers

As @CommonsWare pointed out, I had two options for replacing my JobIntentService:

  1. Using a foreground service
  2. Using a WorkManager with a long-running worker

The Android documentation on services states:

The WorkManager API offers a flexible way of scheduling tasks, and is able to run these jobs as foreground services if needed. In many cases, using WorkManager is preferable to using foreground services directly.

Since Google seems to be pushing folks towards WorkManager, that's what I decided to use.

Related