public class LostLocationEngine extends LocationEngine implements com.mapzen.android.lost.api.LostApiClient.ConnectionCallbacks, com.mapzen.android.lost.api.LocationListener
LocationEngine.TypefastestInterval, interval, locationListeners, priority, smallestDisplacement| Constructor and Description |
|---|
LostLocationEngine(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activate the location engine which will connect whichever location provider you are using.
|
void |
deactivate()
Disconnect the location engine which is useful when you no longer need location updates or requesting the users
LocationEngine.getLastLocation(). |
android.location.Location |
getLastLocation()
Returns the Last known location if the location provider is connected and location permissions are granted.
|
static LocationEngine |
getLocationEngine(android.content.Context context) |
boolean |
isConnected()
Check if your location provider has been activated/connected.
|
LocationEngine.Type |
obtainType()
Get the current
LocationEngine LocationEngine.Type being used. |
void |
onConnected()
Invoked when the location provider has connected.
|
void |
onConnectionSuspended()
Invoked when the location provider connection has been suspended.
|
void |
onLocationChanged(android.location.Location location)
Invoked when the Location has changed.
|
void |
removeLocationUpdates()
Dismiss ongoing location update to the location provider.
|
void |
requestLocationUpdates()
Request location updates to the location provider.
|
addLocationEngineListener, getFastestInterval, getInterval, getPriority, getSmallestDisplacement, isBetterLocation, removeLocationEngineListener, setFastestInterval, setInterval, setPriority, setSmallestDisplacementpublic static LocationEngine getLocationEngine(android.content.Context context)
public void activate()
LocationEngine.requestLocationUpdates().activate in class LocationEnginepublic void deactivate()
LocationEngine.getLastLocation(). Before deactivating, you'll need to stop request user location updates
using LocationEngine.removeLocationUpdates().deactivate in class LocationEnginepublic boolean isConnected()
isConnected in class LocationEnginepublic void onConnected()
onConnected in interface com.mapzen.android.lost.api.LostApiClient.ConnectionCallbackspublic void onConnectionSuspended()
onConnectionSuspended in interface com.mapzen.android.lost.api.LostApiClient.ConnectionCallbacks@Nullable public android.location.Location getLastLocation()
getLastLocation in class LocationEnginepublic void requestLocationUpdates()
requestLocationUpdates in class LocationEnginepublic LocationEngine.Type obtainType()
LocationEngineLocationEngine LocationEngine.Type being used.obtainType in class LocationEngineLocationEngine.Type enum.public void removeLocationUpdates()
removeLocationUpdates in class LocationEnginepublic void onLocationChanged(android.location.Location location)
onLocationChanged in interface com.mapzen.android.lost.api.LocationListenerlocation - the new location