1

My App needs to run in background continuously to send the location updates to the server. I tried Timer , Job Scheduler with background service none of these didn't worked. Its working fine when device is active, after entering into Doze mode the timer which i used is getting paused. When the device is active the Timer is getting resumed.

Checked with this Permission also ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS.

Gopinath
  • 21
  • 4
  • Does this answer your question? [Android Service needs to run always (Never pause or stop)](https://stackoverflow.com/questions/15758980/android-service-needs-to-run-always-never-pause-or-stop) – Hamed Goharshad Jul 25 '22 at 08:21

1 Answers1

0

Post OREO there are limits to what you can do on a background thread

Create a foreground service. In which you will put notification for the user while your service is running.

Here is a StackOverflow answer which would help you create that foreground service Foreground Service

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
Narendra_Nath
  • 4,578
  • 3
  • 13
  • 31