Package es.situm.sdk.navigation
Interface NavigationManager
-
public interface NavigationManagerCentral point to update the progress of a user when follows a route
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisRunning()Returns true if the navigation is running, false otherwisebooleanremoveUpdates()Removes all location updates.voidrequestNavigationUpdates(NavigationRequest request, NavigationListener listener)Set the navigation params, and the listener that receives the updated navigation progress.booleanupdateWithLocation(Location location)InformsNavigationManagerobject the change of the user's location
-
-
-
Method Detail
-
requestNavigationUpdates
void requestNavigationUpdates(@NonNull NavigationRequest request, @NonNull NavigationListener listener) throws IllegalArgumentExceptionSet the navigation params, and the listener that receives the updated navigation progress.Can only exist one navigation with one listener at a time. If this method was previously invoked, but
removeUpdates()wasn't,removeUpdates()is called internally.- Parameters:
request-NavigationRequestwith navigation params.NavigationRequest.getRoute()can't be null, andNavigationRequest.getDistanceToGoalThreshold()andNavigationRequest.getOutsideRouteThreshold()must be greater than 0.listener-NavigationListenerthat receives updates of navigation progress.- Throws:
IllegalArgumentException- iflistener,requestorNavigationRequest.getRoute()are null, or ifNavigationRequest.getDistanceToGoalThreshold()orNavigationRequest.getOutsideRouteThreshold()have 0 or negative value.
-
updateWithLocation
boolean updateWithLocation(@NonNull Location location)InformsNavigationManagerobject the change of the user's location- Parameters:
location- newLocationof the user. If null, nothing is done- Returns:
- true if there is a listener to which notify progress update. False if there isn't, so this method do nothing.
-
removeUpdates
boolean removeUpdates()
Removes all location updates. This removes the internal state of the manager, including the listener provided inrequestNavigationUpdates(NavigationRequest, NavigationListener), so it won't receive more progress updates.- Returns:
- true if a listener was removed. False if there was no listener.
-
isRunning
boolean isRunning()
Returns true if the navigation is running, false otherwise
-
-