public static class

LocationRequestOptions.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.location.LocationRequestOptions.Builder

Class Overview

Builder to construct LocationRequestOptions.

Summary

Public Constructors
Builder()
Public Methods
LocationRequestOptions create()
Creates the location request.
LocationRequestOptions.Builder setMinDistance(float meters)
Sets the min distance between location updates.
LocationRequestOptions.Builder setMinTime(long time, TimeUnit unit)
Sets the min time between location updates.
LocationRequestOptions.Builder setPriority(int priority)
Sets the priority of the location request.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder ()

Public Methods

public LocationRequestOptions create ()

Creates the location request.

Returns
  • The new location request option.

public LocationRequestOptions.Builder setMinDistance (float meters)

Sets the min distance between location updates.

Defaults to DEFAULT_UPDATE_INTERVAL_METERS

Parameters
meters The distance in meters.
Returns
  • The builder.
Throws
IllegalArgumentException if distance is less than 0.

public LocationRequestOptions.Builder setMinTime (long time, TimeUnit unit)

Sets the min time between location updates.

Defaults to DEFAULT_UPDATE_INTERVAL_MILLISECONDS

Parameters
time The duration.
unit The unit of duration.
Returns
  • The builder.
Throws
IllegalArgumentException if time is less than 0.

public LocationRequestOptions.Builder setPriority (int priority)

Sets the priority of the location request.

Defaults to DEFAULT_REQUEST_PRIORITY

Parameters
priority The priority.
Returns
  • The builder.
Throws
IllegalArgumentException if priority is not PRIORITY_HIGH_ACCURACY, PRIORITY_BALANCED_POWER_ACCURACY, PRIORITY_LOW_POWER, or PRIORITY_NO_POWER.