java.lang.Object | |
↳ | sofia.gps.LocationTracker |
TODO document
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | LocationTracker.Accuracy | Indicates the desired accuracy used for location tracking. | |||||||||
enum | LocationTracker.Power | TODO comment |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LocationTracker(Activity context) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LocationTracker.Accuracy |
getAccuracy()
Gets the desired accuracy (fine or coarse) of the location tracker.
| ||||||||||
double |
getMinimumDistance()
Gets the minimum distance, in meters, that the user must travel before
another location notification is sent.
| ||||||||||
LocationTracker.Power |
getPowerRequirement()
Gets the maximum power level that can be used to track the user's
location.
| ||||||||||
double |
getTimeInterval()
Gets the minimum amount of time, in seconds, that should pass between
location notifications.
| ||||||||||
boolean |
isAltitudeRequired()
Gets a value indicating whether the user's altitude must be reported
along with his or her geographical location.
| ||||||||||
boolean |
isBearingRequired()
Gets a value indicating whether the user's bearing (compass direction)
must be reported along with his or her geographical location.
| ||||||||||
boolean |
isCostAllowed()
Gets a value indicating whether monetary costs (such as data charges)
may be incurred in order to track the user's location.
| ||||||||||
boolean |
isSpeedRequired()
Gets a value indicating whether the user's speed should be reported in
addition to his or her geographical position.
| ||||||||||
boolean |
isTracking()
Gets a value indicating whether location tracking is currently active.
| ||||||||||
boolean |
isTrackingPossible()
Gets a value indicating whether the current device is capable of
tracking locations, using either GPS hardware or wireless networks.
| ||||||||||
void |
presentLocationSettings()
Presents the GPS options screen to the user. | ||||||||||
void |
setAccuracy(LocationTracker.Accuracy accuracy)
Sets the desired accuracy (fine or coarse) of the location tracker.
| ||||||||||
void |
setAltitudeRequired(boolean altitude)
Sets a value indicating whether the user's altitude must be reported
along with his or her geographical location.
| ||||||||||
void |
setBearingRequired(boolean bearing)
Sets a value indicating whether the user's bearing (compass direction)
must be reported along with his or her geographical location.
| ||||||||||
void |
setCostAllowed(boolean cost)
Sets a value indicating whether monetary costs (such as data charges)
may be incurred in order to track the user's location.
| ||||||||||
void |
setMinimumDistance(double distance)
Sets the minimum distance, in meters, that the user must travel before
another location notification is sent.
| ||||||||||
void |
setPowerRequirement(LocationTracker.Power power)
Sets the maximum power level that can be used to track the user's
location.
| ||||||||||
void |
setSpeedRequired(boolean speed)
Sets a value indicating that the user's speed should be reported in
addition to his or her geographical position.
| ||||||||||
void |
setTimeInterval(double seconds)
Sets the minimum amount of time, in seconds, that should pass between
location notifications.
| ||||||||||
void |
startTracking()
Begins tracking the user's location. | ||||||||||
void |
stopTracking()
Stops tracking the user's location. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the desired accuracy (fine or coarse) of the location tracker.
LocationTracker.Accuracy
of the location tracker
Gets the minimum distance, in meters, that the user must travel before another location notification is sent.
Gets the maximum power level that can be used to track the user's location.
LocationTracker.Power
level that can be used to track the
user's location
Gets the minimum amount of time, in seconds, that should pass between location notifications. Applications that need to track the user's location in real-time (for example, to display it in an active GUI), should set this low with the understanding that it will put more strain on the battery.
Gets a value indicating whether the user's altitude must be reported along with his or her geographical location. Not all devices and location providers are able to provide this information.
Gets a value indicating whether the user's bearing (compass direction) must be reported along with his or her geographical location. Not all devices and location providers are able to provide this information.
Gets a value indicating whether monetary costs (such as data charges) may be incurred in order to track the user's location.
Gets a value indicating whether the user's speed should be reported in addition to his or her geographical position. Not all devices and location providers are able to provide this information.
Gets a value indicating whether location tracking is currently active.
Gets a value indicating whether the current device is capable of tracking locations, using either GPS hardware or wireless networks.
Presents the GPS options screen to the user. Applications that use the location tracker should make this screen available in some way so that users can enable/disable GPS if needed.
When the user has finished configuring the tracker, the
gpsOptionsDidFinish
method will be called on the owning
activity.
Sets the desired accuracy (fine or coarse) of the location tracker.
accuracy | the desired LocationTracker.Accuracy of the location tracker
|
---|
Sets a value indicating whether the user's altitude must be reported along with his or her geographical location. Not all devices and location providers are able to provide this information.
altitude | true if altitude information is required, otherwise false |
---|
Sets a value indicating whether the user's bearing (compass direction) must be reported along with his or her geographical location. Not all devices and location providers are able to provide this information.
bearing | true if bearing information is required, otherwise false |
---|
Sets a value indicating whether monetary costs (such as data charges) may be incurred in order to track the user's location.
cost | true if monetary costs may be incurred in order to track the user's location, otherwise false |
---|
Sets the minimum distance, in meters, that the user must travel before another location notification is sent.
distance | the minimum distance, in meters, that the user must travel before another location notification is sent |
---|
Sets the maximum power level that can be used to track the user's location.
power | the maximum LocationTracker.Power level that can be used to track
the user's location
|
---|
Sets a value indicating that the user's speed should be reported in addition to his or her geographical position. Not all devices and location providers are able to provide this information.
speed | true if speed information is required, otherwise false |
---|
Sets the minimum amount of time, in seconds, that should pass between location notifications. Applications that need to track the user's location in real-time (for example, to display it in an active GUI), should set this low with the understanding that it will put more strain on the battery.
seconds | the minimum amount of time, in seconds, that should pass between location notifications |
---|
Begins tracking the user's location.
If this LocationTracker
's context is a Sofia
Screen
, then tracking will automatically be stopped
when the screen is paused (leaves the display) and restarted when the
screen is resumed.
Stops tracking the user's location.
If this LocationTracker
's context is a Screen
,
then this method is called automatically when that screen is paused
(removed from the display). You can call it directly if you wish to stop
tracking at some other point (such as when a destination is reached, or
if the user requests it).