public interface LocationEngine
Modifier and Type | Method and Description |
---|---|
void |
getLastLocation(LocationEngineCallback<LocationEngineResult> callback)
Returns the most recent location currently available.
|
void |
removeLocationUpdates(LocationEngineCallback<LocationEngineResult> callback)
Removes location updates for the given location engine callback.
|
void |
removeLocationUpdates(PendingIntent pendingIntent)
Removes location updates for the given pending intent.
|
void |
requestLocationUpdates(LocationEngineRequest request,
LocationEngineCallback<LocationEngineResult> callback,
Looper looper)
Requests location updates with a callback on the specified Looper thread.
|
void |
requestLocationUpdates(LocationEngineRequest request,
PendingIntent pendingIntent)
Requests location updates with callback on the specified PendingIntent.
|
void getLastLocation(LocationEngineCallback<LocationEngineResult> callback) throws java.lang.SecurityException
If a location is not available, which should happen very rarely, null will be returned.
callback
- LocationEngineCallback
for the location result LocationEngineResult
.java.lang.SecurityException
- if permission is not granted to access location services.void requestLocationUpdates(LocationEngineRequest request, LocationEngineCallback<LocationEngineResult> callback, Looper looper) throws java.lang.SecurityException
request
- LocationEngineRequest
for the updates.callback
- LocationEngineCallback
for the location result LocationEngineResult
.looper
- The Looper object whose message queue will be used to implement the callback mechanism,
or null to invoke callbacks on the main thread.java.lang.SecurityException
- if permission is not granted to access location services.void requestLocationUpdates(LocationEngineRequest request, PendingIntent pendingIntent) throws java.lang.SecurityException
request
- LocationEngineRequest
for the updates.pendingIntent
- PendingIntent
for the location result LocationEngineResult
.java.lang.SecurityException
- if permission is not granted to access location services.void removeLocationUpdates(LocationEngineCallback<LocationEngineResult> callback)
It is recommended to remove location requests when the activity is in a paused or stopped state, doing so helps battery performance.
callback
- LocationEngineCallback
to remove.void removeLocationUpdates(PendingIntent pendingIntent)
It is recommended to remove location requests when the activity is in a paused or stopped state, doing so helps battery performance.
pendingIntent
- PendingIntent
to remove.© 2017–2018 Mapbox. All rights reserved.