public interface FusedLocationProviderApi
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_LOCATION_CHANGED
|
| Modifier and Type | Method and Description |
|---|---|
android.location.Location |
getLastLocation(LostApiClient client)
Returns the best most recent location currently available.
|
LocationAvailability |
getLocationAvailability(LostApiClient client)
Returns the availability of location data.
|
PendingResult<Status> |
removeLocationUpdates(LostApiClient client,
LocationCallback callback)
Remove location updates for the
LocationCallback |
PendingResult<Status> |
removeLocationUpdates(LostApiClient client,
LocationListener listener)
Removes location updates for the
LocationListener |
PendingResult<Status> |
removeLocationUpdates(LostApiClient client,
android.app.PendingIntent callbackIntent)
Removes location updates for the
PendingIntent |
PendingResult<Status> |
requestLocationUpdates(LostApiClient client,
LocationRequest request,
LocationCallback callback,
android.os.Looper looper)
Request location updates to be called on the
LocationCallback on a given thread. |
PendingResult<Status> |
requestLocationUpdates(LostApiClient client,
LocationRequest request,
LocationListener listener)
Request location updates to be called on the
LocationListener. |
PendingResult<Status> |
requestLocationUpdates(LostApiClient client,
LocationRequest request,
LocationListener listener,
android.os.Looper looper)
Request location updates to be called on the
LocationListener on a given thread. |
PendingResult<Status> |
requestLocationUpdates(LostApiClient client,
LocationRequest request,
android.app.PendingIntent callbackIntent)
Requests location updates with a callback on the specified PendingIntent.
|
PendingResult<Status> |
setMockLocation(LostApiClient client,
android.location.Location mockLocation)
Sets the mock location to be used for the location provider.
|
PendingResult<Status> |
setMockMode(LostApiClient client,
boolean isMockMode)
Sets whether or not the location provider is in mock mode.
|
PendingResult<Status> |
setMockTrace(LostApiClient client,
java.lang.String path,
java.lang.String filename)
Sets a mock trace file to be used to report location for the location provider.
|
@Deprecated static final java.lang.String KEY_LOCATION_CHANGED
LocationResult.hasResult(android.content.Intent) and
LocationResult.extractResult(android.content.Intent).android.location.Location getLastLocation(LostApiClient client)
client - The client to return location for.java.lang.IllegalStateException - if the client is not connected at the time of this call.LocationAvailability getLocationAvailability(LostApiClient client)
LocationManager has a last known GPS location
or
Network location is enabled and the LocationManager has a last known
Network location
This method can return null if there is a problem getting the availability.client - The client to return availability for.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, LocationListener listener)
LocationListener.
This method is suited for foreground use cases and callbacks for the LocationListener
will be made on the calling thread, which must already be a prepared looper thread. For
handling on a background thread it is recommended that you use the PendingIntent
version of this method requestLocationUpdates(LostApiClient,
LocationRequest, PendingIntent).client - Client to request updates for, must be connected when making this call.request - Specifies desired location accuracy, update interval, etc.listener - Listener to make calls on when location becomes available.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, LocationListener listener, android.os.Looper looper)
LocationListener on a given thread.
This method is suited for foreground use cases and callbacks for the LocationListener
will be made on the given thread, which must already be a prepared looper thread. For
handling on a background thread it is recommended that you use the PendingIntent
version of this method requestLocationUpdates(LostApiClient,
LocationRequest, PendingIntent).client - Client to request updates for, must be connected when making this call.request - Specifies desired location accuracy, update interval, etc.listener - Listener to make calls on when location becomes available.looper - Looper to implement the listener callbacks on.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, LocationCallback callback, android.os.Looper looper)
LocationCallback on a given thread.
This method is suited for foreground use cases and callbacks for the LocationCallback
will be made on the given thread, which must already be a prepared looper thread. For
handling on a background thread it is recommended that you use the PendingIntent
version of this method requestLocationUpdates(LostApiClient,
LocationRequest, PendingIntent).client - Client to request updates for, must be connected when making this call.request - Specifies desired location accuracy, update interval, etc.callback - Callback to make calls on when location becomes available.looper - Looper to implement the listener callbacks on.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, android.app.PendingIntent callbackIntent)
LocationListener &
LocationCallback) versions of this method.
Both LocationResult and LocationAvailability are sent with the
PendingIntent. You can extract them using
LocationResult.hasResult(android.content.Intent),
LocationResult.extractResult(android.content.Intent),
LocationAvailability.hasLocationAvailability(android.content.Intent), and
LocationAvailability.extractLocationAvailability(android.content.Intent).client - Client to request updates for, must be connected when making this call.request - Specifies desired location accuracy, update interval, etc.callbackIntent - Intent to be sent for each location update.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener)
LocationListenerclient - Client which registered the listener. The client must be connected at the time
of this call.listener - Listener to remove updates for.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> removeLocationUpdates(LostApiClient client, android.app.PendingIntent callbackIntent)
PendingIntentclient - Client which registered the pending intent. The client must be connected at the
time of this call.callbackIntent - Intent to remove updates for.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationCallback callback)
LocationCallbackclient - Client which registered the location callback. The client must be connected at
the time of this call.callback - Callback to remove updates for.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> setMockMode(LostApiClient client, boolean isMockMode)
LostApiClients connected to the FusedLocationProviderApi.
Mock mode must be enabled before clients are able to call
setMockLocation(LostApiClient, Location) and
setMockTrace(LostApiClient, String, String)client - Connected client.isMockMode - Whether mock mode should be enabled or not.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> setMockLocation(LostApiClient client, android.location.Location mockLocation)
client - Connected client.mockLocation - Location to be set for the location provider.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.PendingResult<Status> setMockTrace(LostApiClient client, java.lang.String path, java.lang.String filename)
client - Connected client.path - storage directory containing GPX trace to be used to report location.filename - filename of GPX trace to be used to report location.PendingResult for the call to check whether call was successful.java.lang.IllegalStateException - if the client is not connected at the time of this call.