HERE Android SDK Developer's Guide

NavigationManagerEventListener

The class NavigationManagerEventListener is a member of com.here.android.mpa.guidance.NavigationManager.

Class Summary

public static abstract class NavigationManager.NavigationManagerEventListener

extends java.lang.Object

NavigationManagerEventListener provides callback of general navigation manager related events from NavigationManager .

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in NavigationManagerEventListener
Constructors

NavigationManagerEventListener ()

Method Summary

Table 2. Methods in NavigationManagerEventListener
Methods

public void onCountryInfo (String currentCountry, String nextCountry)

Callback when country changes.

public void onEnded (NavigationMode mode)

Callback when navigation, simulation or tracking has just been ended.

public void onMapDataAvailable ()

Called when navigation manager resumes after previously suspending due to a lack of map data.

public void onMapDataInsufficient ()

Called when navigation manager suspends due to insufficient map data.

public void onMapUpdateModeChanged (MapUpdateMode mode)

Callback when the map update mode has been changed

public void onNavigationModeChanged ()

Callback for Navigation Mode changed event.

public void onRouteUpdated (Route newRoute)

Callback to notify that setRoute(Route) has taken effect.

public void onRunningStateChanged ()

Callback for Navigation Manager state changed event.

public void onStopoverReached (int index)

Callback indicating that a route stopover has been reached.

Class Details

NavigationManagerEventListener provides callback of general navigation manager related events from NavigationManager . By default, empty implementations are provided for each callback, users may selectively overload specific methods that are of interest.

Constructor Details

NavigationManagerEventListener ()

Method Details

public void onCountryInfo (String currentCountry, String nextCountry)

Callback when country changes.

No callback will be triggered if the HERE license key is invalid.

Parameters:

  • currentCountry

    The 3-letter country code related to current position

  • nextCountry

    The 3-letter country code you are entering

public void onEnded (NavigationMode mode)

Callback when navigation, simulation or tracking has just been ended.

Parameters:

public void onMapDataAvailable ()

Called when navigation manager resumes after previously suspending due to a lack of map data.

This may be used as a notification that the map data for guidance is available again after previously being unavailable for the current location. This callback is only made if onMapDataInsufficient() was previously called. This callback will not be made if guidance is stopped before map data becomes available again.

public void onMapDataInsufficient ()

Called when navigation manager suspends due to insufficient map data.

In order to operate NavigationManager relies on a constant stream of map matched positions from PositioningManager. One reason that map matching can fail is if map data for the current location is not available. If this situation arises then this callback will be made. If Map has never been used to view a particular location since your app was installed (note that map data is cached across app launches), MapLoader has not been used to download an MapPackage for this location, no network connection is available and navigation progresses to this location then the scenario described above will occur. To guarantee that navigation never encounters problems in poor network conditions use MapLoader to download map data for the region being navigated. Once map data is available again, onMapDataAvailable() will be called.

public void onMapUpdateModeChanged (MapUpdateMode mode)

Callback when the map update mode has been changed

Parameters:

public void onNavigationModeChanged ()

Callback for Navigation Mode changed event.

public void onRouteUpdated (Route newRoute)

Callback to notify that setRoute(Route) has taken effect.

Parameters:

  • newRoute

    The new Route used by the NavigationManager.

public void onRunningStateChanged ()

Callback for Navigation Manager state changed event.

public void onStopoverReached (int index)

Callback indicating that a route stopover has been reached.

Note that in addition to this, onManeuverEvent() callback will also be received. Furthermore, note that a RouteWaypoint of type RouteWaypoint.Type#VIA_WAYPOINT is not considered to be a route stopover.

Parameters:

  • index

    The index of the stopover that was reached, starting from 0. Stopovers can be retrieved by index from the RoutePlan.

See also:

getWaypoint(int)