3

Is it possible to fetch location with PRIORITY_BALANCED_POWER_ACCURACY or PRIORITY_LOW_POWER even when GPS is of HIGH_ACCURACY using Google Play Services lib?

Scenario here is I want to use location with high accuracy for some cases in my app, but for some cases, low accuracy mode is enough. So to save battery for later cases, I want to use low accuracy mode.

bpsingh
  • 363
  • 1
  • 4
  • 18

1 Answers1

0

You could configure two LocationRequests. One with PRIORITY_HIGH_ACCURACY and one with PRIORITY_BALANCED_POWER_ACCURACY or PRIORITY_LOW_POWER. Request location updates for the high accuracy request only when needed and remove the location request when you don't need it anymore. You'd probably have to wait a bit until a GPS fix is established and the desired accuracy is reached.

Emanuel Seidinger
  • 1,272
  • 1
  • 12
  • 21
  • @Emauel : In the question it is asked that if GPS is currently with PRIORITY_HIGH_ACCURACY, when requesting location updates with PRIORITY_LOW_POWER will GPS return location with HIGH OR LOW accuracy? – aagam94 Nov 18 '15 at 13:16
  • @aagam94 : In the second paragraph he describes the scenario. He needs high accuracy only sometimes. For the rest of the time he only wants low accuracy to save battery power. He cannot have both with only one LocationRequest. – Emanuel Seidinger Nov 18 '15 at 13:31