0
  • I'm using a foreground service to fetch GPS with an interval of 30 seconds and save it in DB. I use alarm manager to post GPS logs every 15 minutes from DB,this seems to work even in doze mode with setExactAndAllowWhileIdle() but GPS passively stops working in doze hence DB is empty in duration of doze mode

I've tried to whitelist the app which uses a manifest permission ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS which violets google play policies while app publish. Also Samsung devices J6 which I'm developing for has unmonitored apps option in settings which seem similar to app whitelisting which is not handled.

I have read about doze mode and it's maintenance windows for deferred work but I want to actively get GPS even if device goes to sleep and stationary

How to achieve this fine kettle of fish?

coderBox
  • 140
  • 1
  • 12
  • `Location services may be disabled when the screen is off.`. Google may kill Android in decade or so. Check [more](https://developer.android.com/about/versions/pie/power) – M D Apr 26 '19 at 13:00
  • @MD That is what I don't want..Is there a way to keep it alive? – coderBox Apr 26 '19 at 13:18
  • Please ask to Google for this. – M D Apr 30 '19 at 05:48

0 Answers0