0

Im trying to get location in my Android app, saving as much battery as possible. Im setting PRIORITY_HIGH_ACCURACY because I need the location to be better than about 20m, so I understand that it will be always using the GPS

The function getMinUpdateDistanceMeters description says:

"The fastest allowed interval of location updates. Location updates may arrive faster than the desired interval (getIntervalMillis()), but will never arrive faster than specified here. FLP APIs make some allowance for jitter with the minimum update interval, so clients need not worry about location updates that arrive a couple milliseconds too early being rejected."

Does it make any sense to suppose that setting the minimum distance will save any battery, when It has to check the location anyway to calculate the distance it has moved?

Is there a better more detailed explanation on how Android combines the different settings (priority, intervals, distance) to determine when to get a new location?

Regards

PMF
  • 1

1 Answers1

0

Device battery consumption mainly depends on accuracy, if you set Accuracy to 'PRIORITY_HIGH_ACCURACY' battery drain will be more. I think changing interval wont effect much on battery. setFastestInterval()/ getMinUpdateDistanceMeters() wont save much battery as it provides update when other apps in the device request for location and its with in setFastestInterval()/getMinUpdateDistanceMeters(). Setting setInterval() for longer duration might reduce battery since it reduces calculation interval. Refer to this document for more info - https://developer.android.com/guide/topics/location/battery

vikas naik
  • 11
  • 2
  • Hi, I have read that document, and still believe that the information is very incomplete/insufficient to understand how the provided functions behave – PMF Aug 02 '23 at 23:50