public class LocationSettings
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
PROFILE_BALANCED
Apply a balanced power profile to location updates.
|
static int |
PROFILE_HIGH_POWER_ACCURATE
Apply a profile that gives a high level of accuracy, at the expense of power consumption.
|
static int |
PROFILE_LOW_POWER
Apply a low-power profile.
|
Constructor and Description |
---|
LocationSettings(int powerProfile,
double distance)
Specify settings that rely on updates coming at a given distance travelled (inexact).
|
LocationSettings(int powerProfile,
long timeBetweenUpdates)
Specify settings that rely on updates coming at a given interval (inexact).
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
getDistance()
Get the distance that will be travelled between location updates.
|
int |
getPowerProfile()
Get the power profile associated with this LocationSettings object.
|
java.lang.Long |
getTimeBetweenUpdates()
Get the time interval between updates.
|
public static final int PROFILE_BALANCED
public static final int PROFILE_HIGH_POWER_ACCURATE
public static final int PROFILE_LOW_POWER
public LocationSettings(int powerProfile, long timeBetweenUpdates)
powerProfile
- the power profile to use. Must be one of the PROFILE_* values defined in this class.timeBetweenUpdates
- a time in milliseconds that the handset will
attempt to match when providing updates. Must be 0 or greater.public LocationSettings(int powerProfile, double distance)
powerProfile
- the power profile to use. Must be one of the PROFILE_* values defined in this class.distance
- the distance in meters that the handset should move before
receiving updates. Must be 0 or greater.public int getPowerProfile()
public java.lang.Long getTimeBetweenUpdates()
Long
expressing the time interval,
or null
if this LocationSettings
object is based around distances.public java.lang.Double getDistance()
Double
representing the distance in metres, or null
if
this LocationSettings
object is based around time intervals.