I need to perform background operations when my app is completely killed.I want to send data to the server in every 10 second when my app is killed. how to perform this task.
Asked
Active
Viewed 365 times
1 Answers
0
When Android kills your app process, it can do nothing at all. Android prevents apps from doing background work in order to save battery and bandwidth for the end user. Only system processes can stay running indefinitely. I suggest reading the documentation to understand how it works.
If you want to do background work in a battery-efficient way, you should use WorkManager to schedule that.

Doug Stevenson
- 297,357
- 32
- 422
- 441