4

I'm trying to fetch the user's location every 15 minutes, whether the app is in the foreground, background, or killed.

I've implemented a WorkManager, which works well on my Pixel in all 3 cases above. But I've just read that many phone manufacturers, including Samsung, often kill Workers either through battery optimization or otherwise, despite it often violating Google's policy:

https://stackoverflow.com/a/52605503/14968122

Do I have any options here to address my Workers being killed by these manufacturers? Are there workarounds or other solutions/implementations that I should be aware of to prevent these manufacturers from stopping my Workers?

Thanks you

user1695123
  • 103
  • 1
  • 14

1 Answers1

1

Check here:

https://dontkillmyapp.com/

Ask to be exempted from Battery optimization:

https://developer.android.com/training/monitoring-device-state/doze-standby#support_for_other_use_cases

But no matter what - this is Android. There is no bulletproof solution.

Yavor Mitev
  • 1,363
  • 1
  • 10
  • 22