java.lang.Object | ||
↳ | com.urbanairship.BaseManager | |
↳ | com.urbanairship.location.UALocationManager |
High level interface for interacting with location.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addLocationListener(LocationListener listener)
Adds a listener for locations updates.
| ||||||||||
LocationRequestOptions |
getLocationRequestOptions()
Gets the location request options for continuous updates.
| ||||||||||
boolean |
isBackgroundLocationAllowed()
Checks if continuous location updates are allowed to continue
when the application is in the background.
| ||||||||||
boolean |
isLocationUpdatesEnabled()
Checks if continuous location updates is enabled or not.
| ||||||||||
void |
removeLocationListener(LocationListener listener)
Removes location update listener.
| ||||||||||
PendingResult<Location> |
requestSingleLocation(LocationRequestOptions requestOptions)
Records a single location using custom location request options.
| ||||||||||
PendingResult<Location> |
requestSingleLocation()
Records a single location using either the foreground request options
or the background request options depending on the application's state.
| ||||||||||
void |
setBackgroundLocationAllowed(boolean enabled)
Enable or disable allowing continuous updates to continue in
the background.
| ||||||||||
void |
setLocationRequestOptions(LocationRequestOptions options)
Sets the location request options for continuous updates.
| ||||||||||
void |
setLocationUpdatesEnabled(boolean enabled)
Enable or disable continuous location updates.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
init()
Initialize the manager.
| ||||||||||
void |
tearDown()
Tear down the manager.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Adds a listener for locations updates. The listener will only be notified of continuous location updates, not single location requests.
listener | A location listener. |
---|
Gets the location request options for continuous updates. If no options
have been set, it will default to createDefaultOptions()
.
Checks if continuous location updates are allowed to continue when the application is in the background.
true
if continuous location update are allowed,
otherwise false
.
Checks if continuous location updates is enabled or not.
Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).true
if location updates are enabled, otherwise
false
.
Removes location update listener.
listener | A location listener. |
---|
Records a single location using custom location request options.
requestOptions | The location request options. |
---|
IllegalArgumentException | if the requestOptions is null. |
---|
Records a single location using either the foreground request options or the background request options depending on the application's state.
Enable or disable allowing continuous updates to continue in the background.
enabled | If background updates are allowed in the background or not. |
---|
Sets the location request options for continuous updates.
options | The location request options, or null to reset the options to the default settings. |
---|
Enable or disable continuous location updates.
Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).enabled | If location updates should be enabled or not. |
---|