Priority

  • Priority is an abstract interface used with FusedLocationProviderClient to define location power versus accuracy priority levels.

  • Priority values match framework QUALITY constants, where higher priorities have lower values.

  • Available priority constants include BALANCED_POWER_ACCURACY, HIGH_ACCURACY, LOW_POWER, and PASSIVE, each representing a different tradeoff between location accuracy and power usage.

  • Inherited methods from the Annotation interface include annotationType(), equals(), hashCode(), and toString().

public abstract @interfacePriority implementsAnnotation

Location power vs accuracy priority levels to be used with APIs withinFusedLocationProviderClient.

Priority values have been intentionally chosen to match the framework QUALITY constants, and the values are specified such that higher priorities should always have lower values and vice versa.

Constant Summary

int PRIORITY_BALANCED_POWER_ACCURACYRequests a tradeoff that is balanced between location accuracy and power usage.
int PRIORITY_HIGH_ACCURACYRequests a tradeoff that favors highly accurate locations at the possible expense of additional power usage.
int PRIORITY_LOW_POWERRequests a tradeoff that favors low power usage at the possible expense of location accuracy.
int PRIORITY_PASSIVEEnsures that no extra power will be used to derive locations.

Inherited Method Summary

From interface java.lang.annotation.Annotation
abstractClass<? extends Annotation>
annotationType()
abstract boolean
equals(Object arg0)
abstract int
hashCode()
abstractString
toString()

Constants

public static final intPRIORITY_BALANCED_POWER_ACCURACY

Requests a tradeoff that is balanced between location accuracy and power usage.

Constant Value:102

public static final intPRIORITY_HIGH_ACCURACY

Requests a tradeoff that favors highly accurate locations at the possible expense of additional power usage.

Constant Value:100

public static final intPRIORITY_LOW_POWER

Requests a tradeoff that favors low power usage at the possible expense of location accuracy.

Constant Value:104

public static final intPRIORITY_PASSIVE

Ensures that no extra power will be used to derive locations. This enforces that the request will act as a passive listener that will only receive "free" locations calculated on behalf of other clients, and no locations will be calculated on behalf of only this request.

Constant Value:105

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.