Criteria class(http://developer.android.com/reference/android/location/Criteria.html) has power requirement criteria. But clearly not explained how exactly it works. With ACCURACY it is more clear. ACCURACY_HIGH -will requires GPS provider. ACCURACY_MEDIUM -WiFi/Mobile network. ACCURACY_Low -Mobile network.
But what about power? Why do we need this criteria if it meets the requirements for accuracy?
For example, what provider will be used if I ask the criteria:
locationCriteria.Accuracy = Accuracy.Fine; (It will require GPS only)
And creteria:
locationCriteria.PowerRequirement = Power.Low; (It will require Non GPS-priveder only)
Not one of the location providers should be meet under these requirements. Nevertheless, the program tries to use the GPS provider. Nothing in this are clear and nothing is not explained anywhere in the network. So do i need digging in the Android source code or what?
That is explained on the
getBestProvider()method documentation.getBestProvider()— and pretty much everything that uses aCriteria, other thangetProviders()— will relax the constraints to try to find a match. The power requirement is the first one that will be relaxed.