1

I am working on an android app that has to update location every 10 seconds. Means I have to do polling for every 10 seconds when user wanted to do.

  • Which one is better to use Service or Geofencing API.
  • Which will be better for reducing battery draining.

Thanks

UserAT152
  • 15
  • 5

1 Answers1

0

You cannot poll every 10s unless you use a foreground Service. O enforces background limits, and doze so unless you are in the foreground, this is a bad idea. You might want to reconsider if that's the best approach at solving your problem and consider alternative APIs like geo-fencing etc.

Rahul
  • 19,744
  • 1
  • 25
  • 29