问题
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?
回答1:
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 .
来源:https://stackoverflow.com/questions/57075329/android-which-background-service-to-use