Package es.situm.sdk.navigation
Interface NavigationManager
-
public interface NavigationManager
Central 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 boolean
isRunning()
Returns true if the navigation is running, false otherwiseboolean
removeUpdates()
Removes all location updates.void
requestNavigationUpdates(NavigationRequest request, NavigationListener listener)
Set the navigation params, and the listener that receives the updated navigation progress.boolean
updateWithLocation(Location location)
InformsNavigationManager
object the change of the user's location
-
-
-
Method Detail
-
requestNavigationUpdates
void requestNavigationUpdates(@NonNull NavigationRequest request, @NonNull NavigationListener listener) throws IllegalArgumentException
Set 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
-NavigationRequest
with navigation params.NavigationRequest.getRoute()
can't be null, andNavigationRequest.getDistanceToGoalThreshold()
andNavigationRequest.getOutsideRouteThreshold()
must be greater than 0.listener
-NavigationListener
that receives updates of navigation progress.- Throws:
IllegalArgumentException
- iflistener
,request
orNavigationRequest.getRoute()
are null, or ifNavigationRequest.getDistanceToGoalThreshold()
orNavigationRequest.getOutsideRouteThreshold()
have 0 or negative value.
-
updateWithLocation
boolean updateWithLocation(@NonNull Location location)
InformsNavigationManager
object the change of the user's location- Parameters:
location
- newLocation
of 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
-
-