public class LocationRequest extends Object
setLocationListener
Modifier and Type | Field and Description |
---|---|
static int |
PRIORITY_HIGH_ACCUARCY
When you need gps location updates
|
static int |
PRIORITY_LOW_ACCUARCY
When accuracy is not important and you want to save battery
|
static int |
PRIORITY_MEDIUM_ACCUARCY
When accuracy is not highly important and you want to save battery
|
Constructor and Description |
---|
LocationRequest()
Empty Constructor
|
LocationRequest(int priority,
long interval)
Simple Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
getInterval()
Gest the request time interval
|
int |
getPriority()
Gets the request priority
|
public static int PRIORITY_HIGH_ACCUARCY
public static int PRIORITY_MEDIUM_ACCUARCY
public static int PRIORITY_LOW_ACCUARCY
public LocationRequest()
public LocationRequest(int priority, long interval)
priority
- The priority we are interested to listen for location updates.
PRIORITY_HIGH_ACCUARCY, PRIORITY_MEDIUM_ACCUARCY, PRIORITY_LOW_ACCUARCY
High priority means gps locations which is CPU intensive and consumes more battery.
Medium priority is less intensive in terms of battery and might return a
gps or a network location which is less accurate.
Low priority won't consume the battery and will return a gps location if
available otherwise the location would be a network location.interval
- time in milliseconds which determines what are the time
intervals that we would like to get updates from the OS.
This is a request only and might not be respected by the underlying OS