public final class

LocationRequest

extends Object
implements Parcelable
java.lang.Object
   ↳ com.steerpath.sdk.location.LocationRequest

Class Overview

A location request defines parameters for how accurate and how frequent location updates should be. LocationRequests need to balance update frequency and accuracy with power consumption, using GPS and Network position will exercise the network increasing the power draw.

Summary

Constants
int PRIORITY_BALANCED_POWER_ACCURACY This priority will try to reduce GPS usage to conserve power without dramatically reducing accuracy.
int PRIORITY_HIGH_ACCURACY High accuracy will use Steerpath indoor positioning, GPS and Network location providers and give the most up to date and accurate location possible.
int PRIORITY_LOW_POWER The low power mode will not use GPS nor Steerpath indoor positioning, but rely on network location.
int PRIORITY_NO_POWER The no power mode will opportunistically provide location updates when the device's other applications use location, but will not cause location discovery to be initiated and hence no power will be directly consumed by this scanning mode.
int PRIORITY_STEERPATH_ONLY This priority will only enable Steerpath Indoor Positioning.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<LocationRequest> CREATOR
Public Constructors
LocationRequest()
Public Methods
static LocationRequest create()
Creates a new LocationRequest with the default settings.
int describeContents()
long getFastestInterval()
Retrieve the minimum interval that updates may be given to the location listener.
int getGpsThreshold()
long getInterval()
Retrieve the currently configured preferred interval.
int getPriority()
Obtain the configured priority, i.e.
LocationRequest setFastestInterval(long fastestInterval)
The fastest interval defines the maximum rate at which updates to the location may be provided.
void setGpsThreshold(int threshold)
This determines the minimum accuracy that GPS must have in order for automatic bluetooth to GPS switch to happen.
LocationRequest setInterval(long interval)
Set the default interval at which updates are to be provided.
LocationRequest setPriority(int priority)
Set the priority of this location request, i.e.
String toString()
void writeToParcel(Parcel out, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int PRIORITY_BALANCED_POWER_ACCURACY

This priority will try to reduce GPS usage to conserve power without dramatically reducing accuracy.

Constant Value: 102 (0x00000066)

public static final int PRIORITY_HIGH_ACCURACY

High accuracy will use Steerpath indoor positioning, GPS and Network location providers and give the most up to date and accurate location possible.

Constant Value: 100 (0x00000064)

public static final int PRIORITY_LOW_POWER

The low power mode will not use GPS nor Steerpath indoor positioning, but rely on network location. Accuracy is typically hundreds of meters.

Constant Value: 104 (0x00000068)

public static final int PRIORITY_NO_POWER

The no power mode will opportunistically provide location updates when the device's other applications use location, but will not cause location discovery to be initiated and hence no power will be directly consumed by this scanning mode.

Constant Value: 105 (0x00000069)

public static final int PRIORITY_STEERPATH_ONLY

This priority will only enable Steerpath Indoor Positioning.

Constant Value: 200 (0x000000c8)

Fields

public static final Creator<LocationRequest> CREATOR

Public Constructors

public LocationRequest ()

Public Methods

public static LocationRequest create ()

Creates a new LocationRequest with the default settings.

Returns
  • a new LocationRequest instance.

public int describeContents ()

public long getFastestInterval ()

Retrieve the minimum interval that updates may be given to the location listener.

Returns
  • the currently configured fastest interval in milliseconds.

public int getGpsThreshold ()

public long getInterval ()

Retrieve the currently configured preferred interval.

Returns
  • the current interval for location updates, in milliseconds.

public int getPriority ()

Obtain the configured priority, i.e. the balance between accuracy and power, for this location request.

Returns
  • The priority of this location request.

public LocationRequest setFastestInterval (long fastestInterval)

The fastest interval defines the maximum rate at which updates to the location may be provided. The intended use case for this is to avoid having to write throttling code into a client, i.e. if the client does something heavy and cannot risk it happening more than once per second, setting the fasters interval is the way to do it.
The default value is 1000ms.

Parameters
fastestInterval the required minimum interval at which updates may be given in milliseconds.
Returns
  • this LocationRequest instance

public void setGpsThreshold (int threshold)

This determines the minimum accuracy that GPS must have in order for automatic bluetooth to GPS switch to happen. The smaller the value, the less likely the GPS will be used.

You may want to configure this to a lower value if you notice that your app is switching to GPS too aggressively inside your buildings. It is recommended that you do not set this value to be lower than 5 (meters).

By default the threshold is 10 (meters).

GPS threshold is valid with LocationRequest.PRIORITY_HIGH_ACCURACY and LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY.

public LocationRequest setInterval (long interval)

Set the default interval at which updates are to be provided. This is not a hard limit, and occasionally updates may be provided more often or less often.

Parameters
interval the interval in milliseconds for how often updates would be preferred
Returns
  • this LocationRequest instance

public LocationRequest setPriority (int priority)

Set the priority of this location request, i.e. how much of battery power should be used vs how up to date and accurate should the location updates be.
The default value is PRIORITY_HIGH_ACCURACY

Parameters
priority the priority for this location request.
Returns
  • this LocationRequest instance

public String toString ()

public void writeToParcel (Parcel out, int flags)