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 minutes. | |||||||||
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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) | ||||||||||
static LocationRequestOptions |
fromJson(JsonValue value)
Creates a LocationRequestOptions from a JSON string.
| ||||||||||
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.Builder |
newBuilder()
Builder factory method.
| ||||||||||
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 minutes.
JSON key for the min distance.
Used with setPriority(int)
to request balanced power and accuracy.
When used with the fused location provider it will use "block" level accuracy, about 100 meter accuracy.
When used with standard android location it will use Criteria.ACCURACY_COARSE and Criteria.POWER_MEDIUM.
Used with setPriority(int)
to request highest level of accuracy.
When used with the fused location provider it will request the highest level of accuracy available.
When used with standard android location it will use Criteria.ACCURACY_FINE and Criteria.POWER_HIGH.
JSON key for the request priority.
Used with setPriority(int)
to request low power location updates.
When used with the fused location provider it will use "city" level accuracy, about 10km accuracy.
When used with standard android location it will use Criteria.ACCURACY_COARSE and Criteria.POWER_LOW.
Used with setPriority(int)
to request location that requires no extra power consumption.
Warning: When used with the standard android location it will only use the PASSIVE provider if available. The passive provider requires ACCESS_FINE_LOCATION permission. If either the provider is missing or missing permissions location will not be gathered.
Creates default request options with DEFAULT_REQUEST_PRIORITY
,
DEFAULT_UPDATE_INTERVAL_MILLISECONDS
, and
DEFAULT_UPDATE_INTERVAL_METERS
.
Creates a LocationRequestOptions from a JSON string.
value | The JSON value. |
---|
JsonException | If the JSON is invalid. |
---|
The minimum distance of meters between location updates.
The minimum time in milliseconds between location updates in milliseconds.
The priority of the request.
Builder factory method.
Returns the objects represented as a JsonValue.