java.lang.Object | |
↳ | com.urbanairship.location.LocationRequestOptions |
High level location requirements to be used for UALocationManager and service.
The class is modeled after the LocationRequest for the Fused Location Provider, but only supports a subset of the options.Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | LocationRequestOptions.Builder | Builder to construct LocationRequestOptions. | |||||||||
@interface | LocationRequestOptions.Priority |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_REQUEST_PRIORITY | Default priority - PRIORITY_BALANCED_POWER_ACCURACY. | |||||||||
float | DEFAULT_UPDATE_INTERVAL_METERS | Default minDistance in meters - 800 meters. | |||||||||
long | DEFAULT_UPDATE_INTERVAL_MILLISECONDS | Default minTime in milliseconds - 5 mins. | |||||||||
String | MIN_DISTANCE_KEY | JSON key for the min distance. | |||||||||
String | MIN_TIME_KEY | JSON key for the min time. | |||||||||
int | PRIORITY_BALANCED_POWER_ACCURACY | Used with setPriority(int)
to request balanced power and accuracy. |
|||||||||
int | PRIORITY_HIGH_ACCURACY | Used with setPriority(int)
to request highest level of accuracy. |
|||||||||
String | PRIORITY_KEY | JSON key for the request priority. | |||||||||
int | PRIORITY_LOW_POWER | Used with setPriority(int)
to request low power location updates. |
|||||||||
int | PRIORITY_NO_POWER | Used with setPriority(int)
to request location that requires no extra power consumption. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final Creator<LocationRequestOptions> | CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static LocationRequestOptions |
createDefaultOptions()
Creates default request options with
DEFAULT_REQUEST_PRIORITY ,
DEFAULT_UPDATE_INTERVAL_MILLISECONDS , and
DEFAULT_UPDATE_INTERVAL_METERS . | ||||||||||
int | describeContents() | ||||||||||
boolean | equals(Object o) | ||||||||||
float |
getMinDistance()
The minimum distance of meters between location updates.
| ||||||||||
long |
getMinTime()
The minimum time in milliseconds between location updates in milliseconds.
| ||||||||||
int |
getPriority()
The priority of the request.
| ||||||||||
static LocationRequestOptions |
parseJson(String json)
Creates a LocationRequestOptions from a JSON string.
| ||||||||||
JsonValue |
toJsonValue()
Returns the objects represented as a JsonValue.
| ||||||||||
String | toString() | ||||||||||
void | writeToParcel(Parcel dest, int flags) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Default priority - PRIORITY_BALANCED_POWER_ACCURACY.
Default minDistance in meters - 800 meters.
Default minTime in milliseconds - 5 mins.
JSON key for the min distance.
Used with setPriority(int)
to request balanced power and accuracy.
Used with setPriority(int)
to request highest level of accuracy.
JSON key for the request priority.
Used with setPriority(int)
to request low power location updates.
Used with setPriority(int)
to request location that requires no extra power consumption.
Creates default request options with DEFAULT_REQUEST_PRIORITY
,
DEFAULT_UPDATE_INTERVAL_MILLISECONDS
, and
DEFAULT_UPDATE_INTERVAL_METERS
.
The minimum distance of meters between location updates.
The minimum time in milliseconds between location updates in milliseconds.
The priority of the request.
Creates a LocationRequestOptions from a JSON string.
json | The JSON string. |
---|
JsonException | If the string is unable to be parsed to a JsonValue .
|
---|
Returns the objects represented as a JsonValue.