Android Jobintentservice Is Deprecated

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?

5

1 Answer

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.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest