Mervin Hemaraju
Mervin Hemaraju

Reputation: 2187

Android: Which Background Service to use?

I have an app where a user can perform a backup (offline) and restore (offline) on a button click. However, i don't know which background service is appropriate to use. Can someone advise me whether to use WorkerManager or Service in this case?

Upvotes: 1

Views: 203

Answers (1)

A Farmanbar
A Farmanbar

Reputation: 4798

I recommend you to use ForegroundService as of the goal of using these services are Long Running Processes that Users should be informed and interact with it .

Consider when you try to backup when you Use ForegroundService then you can show to user

  • The process left to end
  • Cancel Backup
  • Pause
  • and etc

So I recommend you to use this approach .

Upvotes: 3

Related Questions