Search code examples
androidbackground-service

Background service in new Android versions


I have an application with background service (important tasks run in background always). What is your offer for handle important tasks? my application may be close but these tasks must be done.


Solution

  • If your service is doing important task and the application mustn't be close you should use Foreground Service as it will inform the user that you're doing some work.

    If you don't need immediate execution you can use WorkManager. WorkManager offers deferrable but guaranteed execution, it'll run even if you're application is killed.