| java.lang.Object | |
| ↳ | com.steerpath.sdk.location.LocationRequest |
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.
| 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
| |||||||||||
This priority will try to reduce GPS usage to conserve power without dramatically reducing accuracy.
High accuracy will use Steerpath indoor positioning, GPS and Network location providers and give the most up to date and accurate location possible.
The low power mode will not use GPS nor Steerpath indoor positioning, but rely on network location. Accuracy is typically hundreds of meters.
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.
This priority will only enable Steerpath Indoor Positioning.
Creates a new LocationRequest with the default settings.
Retrieve the minimum interval that updates may be given to the location listener.
Retrieve the currently configured preferred interval.
Obtain the configured priority, i.e. the balance between accuracy and power, for this location request.
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.
| fastestInterval | the required minimum interval at which updates may be given in milliseconds. |
|---|
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.
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.
| interval | the interval in milliseconds for how often updates would be preferred |
|---|
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
| priority | the priority for this location request. |
|---|