To get positions with the control mapbox
we use LocationEngine
I see that you can specify the priority, ie the sampling of location data.
locationEngine = LocationSource.getLocationEngine(this);
locationEngine.setPriority(LocationEnginePriority.BALANCED_POWER_ACCURACY);
Here LocationEnginePriority that only says the types:
- BALANCED_POWER_ACCURACY
- HIGH_ACCURACY
- LOW_POWER
- NO_POWER
Searching inside your code mapbox-java :
private void updateCurrentProvider() {
// We might want to explore android.location.Criteria here.
if (priority == LocationEnginePriority.NO_POWER) {
currentProvider = LocationManager.PASSIVE_PROVIDER;
} else if (priority == LocationEnginePriority.LOW_POWER) {
currentProvider = LocationManager.NETWORK_PROVIDER;
} else if (priority == LocationEnginePriority.BALANCED_POWER_ACCURACY) {
currentProvider = LocationManager.NETWORK_PROVIDER;
} else if (priority == LocationEnginePriority.HIGH_ACCURACY) {
currentProvider = LocationManager.GPS_PROVIDER;
}
}
I wonder what difference there is in using LOW_POWER
with BALANCED_POWER_ACCURACY
? the two at first instance get the positions of NETWORK_PROVIDER