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(android.app.PendingIntent pendingIntent)
Removes location updates for the given pending intent.
|
void |
requestLocationUpdates(LocationEngineRequest request,
LocationEngineCallback<LocationEngineResult> callback,
android.os.Looper looper)
Requests location updates with a callback on the specified Looper thread.
|
void |
requestLocationUpdates(LocationEngineRequest request,
android.app.PendingIntent pendingIntent)
Requests location updates with callback on the specified PendingIntent.
|
void getLastLocation(@NonNull
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(@NonNull
LocationEngineRequest request,
@NonNull
LocationEngineCallback<LocationEngineResult> callback,
@Nullable
android.os.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(@NonNull
LocationEngineRequest request,
android.app.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(@NonNull
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(android.app.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.