android - Why is `PRIORITY_BALANCED_POWER_ACCURACY` consuming more battery than `PRIORITY_HIGH_ACCURACY`? -


we benchmarked amount of battery spent device on requesting location every 10 minutes, solely connected wifi, under same circumstances

  • post factory reset
  • same starting battery levels
  • no apps installed

with priority first set priority_balanced_power_accuracy , priority_high_accuracy.

and surprisingly, former used same, if not more battery latter. here graph of battery usage:

could please explain behaviour?

priority_high_accuracy more use gps, , priority_balanced_power_accuracy more use wifi & cell tower positioning.

  • priority_balanced_power_accuracy (~100m "block" accuracy)
  • priority_high_accuracy (accurate possible @ expense of battery life)

    use setinterval(long) , setfastestinterval(long) saving battery life.

example:

private static final long interval = 60 * 1000; private static final long fastest_interval = 5 * 1000; private static final long displacement = 100;  private locationrequest createlocationrequest(){         locationrequest mlocationrequest = new locationrequest();         mlocationrequest.setinterval(interval);         mlocationrequest.setfastestinterval(fastest_interval);         mlocationrequest.setpriority(locationrequest.priority_balanced_power_accuracy);         mlocationrequest.setsmallestdisplacement(displacement);         return mlocationrequest;     } 

google describes locationrequest class here: http://developer.android.com/reference/com/google/android/gms/location/locationrequest.html


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -