Differing Priorities of Mapbox Location on Android

1

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

    
asked by Webserveis 30.05.2017 в 09:51
source

1 answer

2

Translation about the post found:

  

Developers must decide how much energy to use to calculate the location using a combination of Wi-Fi elements, mobile networks and sensors to calculate the location.

Existing this difference in the two elements that you comment

  • PRIORITY_LOW_POWER (~ 10km city precision)
  • PRIORITY_BALANCED_POWER_ACCURACY (~ 100m precision blocked)

You can find the full post at: ( link )

From Google's api:

public static final int PRIORITY_BALANCED_POWER_ACCURACY

To add the level "block" ("blocked") of precision

A precision of 100 meters is considered. Using this type of repetition you often consume less energy

public static final int PRIORITY_HIGH_ACCURACY

Set the highest level of accuracy. Returning the most accurate location

public static final int PRIORITY_LOW_POWER

Set the precision "city" ("city")

A precision of 10 km is considered. It consumes little energy

public static final int PRIORITY_NO_POWER

It will return the best possible location taking into account an extra energy consumption 0

Locations will not be returned unless a different client has requested location updates, in which case this request will act as a passive listener in those locations.

    
answered by 30.05.2017 / 10:06
source