javaandroidbackground-processandroid-intentservicejobintentservice

What are differences between JobIntentService and IntentService?


I do not understand what difference between those two APIs. I mean when to use the first one. Why is there JobIntentService ? Thanks in advance


Solution

  • I would recommend to read this article explaining about the difference between intent service and job intent service. When we look for the first time at these terms Service, IntentService, JobIntentService they would look almost similar - in one way or other they would perform some operations in background (which user does not notice). But there is few difference in the way they operate,

    But from Oreo, if the app is running in background it's not allowed to start the service in background. Android asks us to start the service explicitly by context.startForegroundService instead of context.startService and when the service is started within 5 seconds it must be tied to the notification to have a UI element associated with it.

    Reference : https://developer.android.com/about/versions/oreo/background.html