HERE Android SDK Developer's Guide

NavigationManager

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

Class Summary

public final class NavigationManager

extends java.lang.Object

This class controls turn by turn navigation.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in NavigationManager
Nested Classes

public static final enumeration NavigationManager.AspectRatio

A measure of an image's aspect ratio which is w x h.

public static final enumeration NavigationManager.AudioEvent

Used for enabling/disabling audio events during navigation.

public static abstract class NavigationManager.AudioFeedbackListener

AudioFeedbackListener provides callback of audio related events from NavigationManager .

public class NavigationManager.AudioPlayer

public static final enumeration NavigationManager.Error

Navigation Manager Error

public static abstract class NavigationManager.GpsSignalListener

GpsSignalListener provides callback of GPS signal related events from NavigationManager .

public static abstract class NavigationManager.LaneInformationListener

LaneInformationListener provides callback of LaneInformation related events from NavigationManager .

public static abstract class NavigationManager.ManeuverEventListener

ManeuverEventListener provides callback of maneuver events from NavigationManager .

public static final enumeration NavigationManager.MapUpdateMode

Map Update Mode

public static final enumeration NavigationManager.NaturalGuidanceMode

Enum used to turn on/off features within natural guidance.

public static abstract class NavigationManager.NavigationManagerEventListener

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

public static final enumeration NavigationManager.NavigationMode

Possible Navigation Modes

public static final enumeration NavigationManager.NavigationState

Possible states of navigation

public static abstract class NavigationManager.NewInstructionEventListener

NewInstructionEventListener provides callback of new instruction events from NavigationManager .

public static abstract class NavigationManager.PositionListener

PositionListener provides callback of position events from NavigationManager .

public static abstract class NavigationManager.RealisticViewListener

RealisticViewListenerAdapter provides callback of realistic view related events from NavigationManager .

public static final enumeration NavigationManager.RealisticViewMode

Enum used to turn on/off realistic view (junction view and 2D signs).

public static abstract class NavigationManager.RerouteListener

RerouteListener provides callback of route re-calculation related events from NavigationManager .

public static class NavigationManager.RoadView

This static class controls road view of turn by turn navigation.

public static abstract class NavigationManager.SafetySpotListener

SafetySpotListener provides callback of safety spot related events from NavigationManager .

public static abstract class NavigationManager.SpeedWarningListener

SpeedListener provides callback of speed warning related events from NavigationManager .

public static final enumeration NavigationManager.TrafficAvoidanceMode

Specifies if traffic should be automatically avoided or not during navigation

public static abstract class NavigationManager.TrafficRerouteListener

This adapter class receives notifications from NavigationManager that indicates traffic re-routing events due to the use of different NavigationManager.TrafficAvoidanceModes.

public static final enumeration NavigationManager.TtsOutputFormat

Used for specifying TTS output format in which the text should be generated.

public static final enumeration NavigationManager.UnitSystem

Supported unit system types

Field Summary

Table 2. Fields in NavigationManager
Fields

public static final Date INVALID_ETA_DATE

Represents an invalid time of arrival.

Method Summary

Table 3. Methods in NavigationManager
Methods

public void addAudioFeedbackListener (java.lang.ref.WeakReference <AudioFeedbackListener> listener)

Add a NavigationManager.AudioFeedbackListener to NavigationManager as a WeakReference .

public void addGpsSignalListener (java.lang.ref.WeakReference <GpsSignalListener> listener)

Add a NavigationManager.GpsSignalListener to NavigationManager to subscribe to route re-calculation events.

public void addLaneInformationListener (java.lang.ref.WeakReference <LaneInformationListener> listener)

Add a NavigationManager.LaneInformationListener to NavigationManager to subscribe to lane information related events.

public void addManeuverEventListener (java.lang.ref.WeakReference <ManeuverEventListener> listener)

Add a NavigationManager.ManeuverEventListener to NavigationManager to subscribe to new instruction event(s).

public void addNavigationManagerEventListener (java.lang.ref.WeakReference <NavigationManagerEventListener> listener)

Add a NavigationManager.NavigationManagerEventListener to NavigationManager to subscribe to general info events.

public void addNewInstructionEventListener (java.lang.ref.WeakReference <NewInstructionEventListener> listener)

Add a NavigationManager.NewInstructionEventListener to NavigationManager to subscribe to new instruction event(s).

public void addPositionListener (java.lang.ref.WeakReference <PositionListener> listener)

Add a NavigationManager.PositionListener to NavigationManager to subscribe to position event(s).

public void addRealisticViewAspectRatio (AspectRatio ratio)

Adds an aspect ratio to the realistic view engine.

public void addRealisticViewListener (java.lang.ref.WeakReference <RealisticViewListener> listener)

Add a NavigationManager.RealisticViewListener to NavigationManager as a WeakReference .

public void addRerouteListener (java.lang.ref.WeakReference <RerouteListener> listener)

Add a NavigationManager.RerouteListener to NavigationManager to subscribe to route re-calculation events.

public void addSafetySpotListener (java.lang.ref.WeakReference <SafetySpotListener> listener)

Add a NavigationManager.SafetySpotListener to NavigationManager to subscribe to safety spot event(s).

public void addSpeedWarningListener (java.lang.ref.WeakReference <SpeedWarningListener> listener)

Add a NavigationManager.SpeedWarningListener to NavigationManager to subscribe to speed warning event(s).

public void addTrafficRerouteListener (java.lang.ref.WeakReference <TrafficRerouteListener> listener)

Add a traffic re-route listener as a WeakReference .

public void clearRealisticViewAspectRatios ()

Clear all aspect ratios from the realistic view engine.

public Maneuver getAfterNextManeuver ()

Returns the Maneuver after the next Maneuver

public long getAfterNextManeuverDistance ()

Returns the distance to the Maneuver after the next Maneuver

public AudioPlayer getAudioPlayer ()

Retrieve the Audio Player instance associated with the NavigationManager

public double getAverageSpeed ()

Returns the current average speed.

public String getCountryCode ()

Gets the three-letter country code (defined in ISO 3166-1) from current location.

public long getDestinationDistance ()

Returns the current distance to destination.

public UnitSystem getDistanceUnit ()

Gets the Distance Unit.

public long getElapsedDistance ()

Returns the elapsed distance from start of navigation, tracking or simulation.

public java.util.EnumSet <AudioEvent> getEnabledAudioEvents ()

Gets the set of all NavigationManager.AudioEvents that are currently enabled.

public Date getEta (boolean wholeRoute, TrafficPenaltyMode mode)

Returns the estimated time of arrival (ETA) of the route.

public float getHighSpeedWarningBoundary ()

The current speed boundary in meters/second.

public float getHighSpeedWarningOffset ()

The current high speed warning offset in meters/second.

public static NavigationManager getInstance ()

public float getLowSpeedWarningOffset ()

The current low speed warning offset in meters/second.

public MapUpdateMode getMapUpdateMode ()

Retrieves currently set MapUpdateMode

public java.util.EnumSet <NaturalGuidanceMode> getNaturalGuidanceMode ()

Get the natural guidance modes enabled.

public NavigationMode getNavigationMode ()

Retrieves the current Navigation Mode

public Maneuver getNextManeuver ()

Returns the next maneuver on the route, or null if no next maneuver.

public long getNextManeuverDistance ()

Returns the distance to the next Maneuver

public java.util.EnumSet <AspectRatio> getRealisticViewAspectRatios ()

Gets the aspect ratios currently being returned.

public RealisticViewMode getRealisticViewMode ()

Returns the currently set NavigationManager.RealisticViewMode.

public RoadView getRoadView ()

Retrieve the Road View instance associated with the NavigationManager

public NavigationState getRunningState ()

Retrieves the current Navigation Running State

public TrafficAvoidanceMode getTrafficAvoidanceMode ()

Get the way in which traffic should be handled during navigation.

public TrafficWarner getTrafficWarner ()

Retrieve the traffic warner instance for the navigation manager

public RouteTta getTta (TrafficPenaltyMode mode, boolean wholeRoute)

Returns the Time To Arrival (TTA).

public TtsOutputFormat getTtsOutputFormat ()

Gets the TTS text output format currently in use.

public VoiceSkin getVoiceSkin ()

Gets the voice skin currently in use.

public boolean isSpeedWarningEnabled ()

Get the speed warning status.

public int isTtsLanguageAvailable (Locale locale)

Get the availability of the specified language as represented by the Locale .

public void pause ()

Suspend Navigation temporarily.

public void removeAudioFeedbackListener (AudioFeedbackListener listener)

Remove a NavigationManager.AudioFeedbackListener previously added to NavigationManager .

public void removeGpsSignalListener (GpsSignalListener listener)

Remove a NavigationManager.GpsSignalListener previously added to NavigationManager .

public void removeLaneInformationListener (LaneInformationListener listener)

Remove a NavigationManager.LaneInformationListener previously added to NavigationManager .

public void removeManeuverEventListener (ManeuverEventListener listener)

Remove a NavigationManager.NewInstructionEventListener previously added to NavigationManager

public void removeNavigationManagerEventListener (NavigationManagerEventListener listener)

Remove a NavigationManager.NavigationManagerEventListener previously added to NavigationManager

public void removeNewInstructionEventListener (NewInstructionEventListener listener)

Remove a NavigationManager.NewInstructionEventListener previously added to NavigationManager

public void removePositionListener (PositionListener listener)

Remove a NavigationManager.PositionListener previously added to NavigationManager .

public void removeRealisticViewListener (RealisticViewListener listener)

Remove a NavigationManager.RealisticViewListener previously added to NavigationManager .

public void removeRerouteListener (RerouteListener listener)

Remove a NavigationManager.RerouteListener previously added to NavigationManager .

public void removeSafetySpotListener (SafetySpotListener listener)

Remove a NavigationManager.SafetySpotListener previously added to NavigationManager .

public void removeSpeedWarningListener (SpeedWarningListener listener)

Remove a NavigationManager.SpeedWarningListener previously added to NavigationManager .

public void removeTrafficRerouteListener (TrafficRerouteListener listener)

Remove a traffic re-route listener.

public void repeatVoiceCommand ()

Repeat last voice command.

public Error resume ()

Resume paused Navigation.

public Error setDistanceUnit (UnitSystem us)

Sets the measuring unit system that is used by voice guidance.

public void setEnabledAudioEvents (java.util.EnumSet <AudioEvent> events)

Used to enable/disable the playback of audio events during navigation.

public void setMap (Map map)

Set Map to this Navigation Manager object and show the Navigation on Map .

public Error setMapUpdateMode (MapUpdateMode mode)

Sets the Map Update Mode, different modes changes the way position is updated.

public boolean setNaturalGuidanceMode (java.util.EnumSet <NaturalGuidanceMode> mode)

Set the natural guidance modes to be enabled.

public void setRealisticViewMode (RealisticViewMode mode)

Change realistic view mode.

public Error setRoute (Route route)

Sets the route navigation manager should use.

public Error setRouteRequestInterval (int value)

Set the time period between two re-routing.

public boolean setSpeedWarningEnabled (boolean value)

Set the speed warning state.

public Error setSpeedWarningOptions (float lowSpeedOffset, float highSpeedOffset, float highSpeedBoundary)

Set speed warning options.

public Error setTrafficAvoidanceMode (TrafficAvoidanceMode mode)

Set the way in which traffic should be handled during navigation.

public void setTtsOutputFormat (TtsOutputFormat format)

Sets the TTS text output format.

public Error setVoiceSkin (VoiceSkin skin)

sets the voice skin id for voice Navigation

public Error simulate (Route route, long speed)

Start route simulation.

public Error startNavigation (Route route)

Start navigation along the route.

public Error startTracking ()

Start tracking mode.

public void stop ()

Abort the current operation, which can be route navigation, route simulation or tracking.

public void stopSpeedWarning ()

Stop speed warning notifications for the current navigation session.

Class Details

This class controls turn by turn navigation.

If the user of the application revokes the ACCESS_FINE_LOCATION permission at runtime while NavigationManager is active, navigation will stop functioning. Navigation must be restarted once the ACCESS_FINE_LOCATION permission is restored.

Field Details

public static final Date INVALID_ETA_DATE

Represents an invalid time of arrival.

See also:

getEta(boolean, TrafficPenaltyMode)

Method Details

public void addAudioFeedbackListener (java.lang.ref.WeakReference <AudioFeedbackListener> listener)

Add a NavigationManager.AudioFeedbackListener to NavigationManager as a WeakReference .

Parameters:

public void addGpsSignalListener (java.lang.ref.WeakReference <GpsSignalListener> listener)

Add a NavigationManager.GpsSignalListener to NavigationManager to subscribe to route re-calculation events.

Parameters:

  • listener

    The WeakReference of the GpsSignalListener to be added.

public void addLaneInformationListener (java.lang.ref.WeakReference <LaneInformationListener> listener)

Add a NavigationManager.LaneInformationListener to NavigationManager to subscribe to lane information related events.

Parameters:

  • listener

    The WeakReference of the LaneInformationListener to be added.

public void addManeuverEventListener (java.lang.ref.WeakReference <ManeuverEventListener> listener)

Add a NavigationManager.ManeuverEventListener to NavigationManager to subscribe to new instruction event(s).

Parameters:

  • listener

    The WeakReference of the ManeuverEventListener to be added.

public void addNavigationManagerEventListener (java.lang.ref.WeakReference <NavigationManagerEventListener> listener)

Add a NavigationManager.NavigationManagerEventListener to NavigationManager to subscribe to general info events.

Parameters:

  • listener

    The WeakReference of the NavigationManagerEventListener to be added.

public void addNewInstructionEventListener (java.lang.ref.WeakReference <NewInstructionEventListener> listener)

Add a NavigationManager.NewInstructionEventListener to NavigationManager to subscribe to new instruction event(s).

Parameters:

  • listener

    The WeakReference of the NewInstructionEventListener to be added.

public void addPositionListener (java.lang.ref.WeakReference <PositionListener> listener)

Add a NavigationManager.PositionListener to NavigationManager to subscribe to position event(s).

Parameters:

  • listener

    The WeakReference of the PositionListener to be added.

public void addRealisticViewAspectRatio (AspectRatio ratio)

Adds an aspect ratio to the realistic view engine. By default all aspect ratios are off. Realistic view images are only generated for the requested aspect ratios.

Parameters:

  • ratio

    The aspect ratio to be added.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public void addRealisticViewListener (java.lang.ref.WeakReference <RealisticViewListener> listener)

Add a NavigationManager.RealisticViewListener to NavigationManager as a WeakReference .

Parameters:

public void addRerouteListener (java.lang.ref.WeakReference <RerouteListener> listener)

Add a NavigationManager.RerouteListener to NavigationManager to subscribe to route re-calculation events.

Parameters:

  • listener

    The WeakReference of the RerouteListener to be added.

public void addSafetySpotListener (java.lang.ref.WeakReference <SafetySpotListener> listener)

Add a NavigationManager.SafetySpotListener to NavigationManager to subscribe to safety spot event(s).

Parameters:

  • listener

    The WeakReference of the SafetySpotListener to be added.

public void addSpeedWarningListener (java.lang.ref.WeakReference <SpeedWarningListener> listener)

Add a NavigationManager.SpeedWarningListener to NavigationManager to subscribe to speed warning event(s).

Parameters:

  • listener

    The WeakReference of the SpeedWarningListener to be added.

public void addTrafficRerouteListener (java.lang.ref.WeakReference <TrafficRerouteListener> listener)

Add a traffic re-route listener as a WeakReference .

Parameters:

See also:

NavigationManager.TrafficAvoidanceMode

setTrafficAvoidanceMode(TrafficAvoidanceMode)

public void clearRealisticViewAspectRatios ()

Clear all aspect ratios from the realistic view engine. After this no images will be generated unless new aspect ratios are added with addRealisticViewAspectRatio(AspectRatio)).

Returns:

true if the aspect ratios were cleared, false otherwise.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public Maneuver getAfterNextManeuver ()

Returns the Maneuver after the next Maneuver

Returns:

The Maneuver after the next Maneuver.

public long getAfterNextManeuverDistance ()

Returns the distance to the Maneuver after the next Maneuver

Returns:

distance to the Maneuver after the next Maneuver in meters. Returns -1 if an error occured or if the maneuver after the next maneuver is not available yet.

public AudioPlayer getAudioPlayer ()

Retrieve the Audio Player instance associated with the NavigationManager

Returns:

AudioPlayer instance

public double getAverageSpeed ()

Returns the current average speed.

Returns:

average speed in m/s.

public String getCountryCode ()

Gets the three-letter country code (defined in ISO 3166-1) from current location. Navigation session should be started for this method to work.

Returns:

The country code from current location. null if the information is not available.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public long getDestinationDistance ()

Returns the current distance to destination.

Returns:

the distance to destination in meters.

public UnitSystem getDistanceUnit ()

Gets the Distance Unit. This is the measure unit used for voice guidance

Returns:

The NavigationManager.UnitSystem currently in use.

public long getElapsedDistance ()

Returns the elapsed distance from start of navigation, tracking or simulation.

Returns:

elapsed distance in meters.

public java.util.EnumSet <AudioEvent> getEnabledAudioEvents ()

Gets the set of all NavigationManager.AudioEvents that are currently enabled. Safety spot ( SAFETY_SPOT) and re-routing ( ROUTE) audio events are disabled by default.

Returns:

The set of all enabled events.

public Date getEta (boolean wholeRoute, TrafficPenaltyMode mode)

Returns the estimated time of arrival (ETA) of the route.

Parameters:

  • wholeRoute

    Calculate ETA for the whole route if true or for the current leg if false.

  • mode

    The TrafficPenaltyMode to use.

Returns:

A valid ETA date is returned when actively navigating on a route (when the navigation mode is NAVIGATION or SIMULATION). Note that when a navigation event is being handled (for example, during a route recalculation), a INVALID_ETA_DATE can be returned. A INVALID_ETA_DATE will also be returned if not actively navigating on a route.

public float getHighSpeedWarningBoundary ()

The current speed boundary in meters/second.

Returns:

Boundary for high speed.

See also:

setSpeedWarningOptions(float, float, float)

public float getHighSpeedWarningOffset ()

The current high speed warning offset in meters/second.

Returns:

Offset in high speeds.

See also:

setSpeedWarningOptions(float, float, float)

public static NavigationManager getInstance ()

public float getLowSpeedWarningOffset ()

The current low speed warning offset in meters/second.

Returns:

Offset in low speeds in m/s.

See also:

setSpeedWarningOptions(float, float, float)

public MapUpdateMode getMapUpdateMode ()

Retrieves currently set MapUpdateMode

Returns:

MapUpdateMode enum value

See also:

NavigationManager.MapUpdateMode

public java.util.EnumSet <NaturalGuidanceMode> getNaturalGuidanceMode ()

Get the natural guidance modes enabled.

Returns:

All enabled natural guidance modes.

public NavigationMode getNavigationMode ()

Retrieves the current Navigation Mode

Returns:

The current NavigationManager.NavigationMode

public Maneuver getNextManeuver ()

Returns the next maneuver on the route, or null if no next maneuver.

Returns:

next Maneuver.

public long getNextManeuverDistance ()

Returns the distance to the next Maneuver

Returns:

distance to the next Maneuver in meters. Returns Integer.MAX_VALUE if an error occured or if the next maneuver is not available yet.

public java.util.EnumSet <AspectRatio> getRealisticViewAspectRatios ()

Gets the aspect ratios currently being returned.

Returns:

The EnumSet of aspect ratios.

public RealisticViewMode getRealisticViewMode ()

Returns the currently set NavigationManager.RealisticViewMode.

Returns:

The RealisticViewMode.

public RoadView getRoadView ()

Retrieve the Road View instance associated with the NavigationManager

Returns:

RoadView instance, null if RoadView is not used.

public NavigationState getRunningState ()

Retrieves the current Navigation Running State

Returns:

The current NavigationManager.NavigationState

public TrafficAvoidanceMode getTrafficAvoidanceMode ()

Get the way in which traffic should be handled during navigation.

Returns:

The current NavigationManager.TrafficAvoidanceMode.

public TrafficWarner getTrafficWarner ()

Retrieve the traffic warner instance for the navigation manager

Returns:

The TrafficWarner instance currently in use.

public RouteTta getTta (TrafficPenaltyMode mode, boolean wholeRoute)

Returns the Time To Arrival (TTA).

Parameters:

  • mode

    The Route.TrafficPenaltyMode to use for the calculation. AVOID_CONGESTION is not allowed and will throw a RuntimeException.

  • wholeRoute

    True to return the TTA for the whole route, false for the current leg only.

Returns:

The current RouteTta. Can be null if not currently in guidance.

public TtsOutputFormat getTtsOutputFormat ()

Gets the TTS text output format currently in use.

Returns:

The NavigationManager.TtsOutputFormat used.

public VoiceSkin getVoiceSkin ()

Gets the voice skin currently in use.

Returns:

The voice skin.

public boolean isSpeedWarningEnabled ()

Get the speed warning status.

Returns:

true speed warning is enabled, false otherwise.

public int isTtsLanguageAvailable (Locale locale)

Get the availability of the specified language as represented by the Locale .

Parameters:

  • locale

    The Locale describing the language to be used.

Returns:

Return one of the values below:

  • android.speech.tts.TextToSpeech#LANG_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_COUNTRY_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_COUNTRY_VAR_AVAILABLE
  • android.speech.tts.TextToSpeech#LANG_MISSING_DATA
  • android.speech.tts.TextToSpeech#LANG_NOT_SUPPORTED

See also:

android.speech.tts.TextToSpeech

public void pause ()

Suspend Navigation temporarily.

public void removeAudioFeedbackListener (AudioFeedbackListener listener)

Remove a NavigationManager.AudioFeedbackListener previously added to NavigationManager .

Parameters:

public void removeGpsSignalListener (GpsSignalListener listener)

Remove a NavigationManager.GpsSignalListener previously added to NavigationManager .

Parameters:

  • listener

    The GpsSignalListener to be removed.

public void removeLaneInformationListener (LaneInformationListener listener)

Remove a NavigationManager.LaneInformationListener previously added to NavigationManager .

Parameters:

  • listener

    The LaneInformationListener to be removed.

public void removeManeuverEventListener (ManeuverEventListener listener)

Remove a NavigationManager.NewInstructionEventListener previously added to NavigationManager

Parameters:

  • listener

    The NewInstructionEventListener to be removed.

public void removeNavigationManagerEventListener (NavigationManagerEventListener listener)

Remove a NavigationManager.NavigationManagerEventListener previously added to NavigationManager

Parameters:

  • listener

    The NavigationManagerEventListener to be removed.

public void removeNewInstructionEventListener (NewInstructionEventListener listener)

Remove a NavigationManager.NewInstructionEventListener previously added to NavigationManager

Parameters:

  • listener

    The NewInstructionEventListener to be removed.

public void removePositionListener (PositionListener listener)

Remove a NavigationManager.PositionListener previously added to NavigationManager .

Parameters:

  • listener

    The PositionListener to be removed.

public void removeRealisticViewListener (RealisticViewListener listener)

Remove a NavigationManager.RealisticViewListener previously added to NavigationManager .

Parameters:

public void removeRerouteListener (RerouteListener listener)

Remove a NavigationManager.RerouteListener previously added to NavigationManager .

Parameters:

  • listener

    The RerouteListener to be removed.

public void removeSafetySpotListener (SafetySpotListener listener)

Remove a NavigationManager.SafetySpotListener previously added to NavigationManager .

Parameters:

  • listener

    The SafetySpotListener to be removed.

public void removeSpeedWarningListener (SpeedWarningListener listener)

Remove a NavigationManager.SpeedWarningListener previously added to NavigationManager .

Parameters:

  • listener

    The SpeedWarningListener to be removed.

public void removeTrafficRerouteListener (TrafficRerouteListener listener)

Remove a traffic re-route listener.

Parameters:

See also:

addTrafficRerouteListener(WeakReference<TrafficRerouteListener>)

public void repeatVoiceCommand ()

Repeat last voice command.

public Error resume ()

Resume paused Navigation.

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.

public Error setDistanceUnit (UnitSystem us)

Sets the measuring unit system that is used by voice guidance. The default UnitSystem is METRIC.

Note: If a new VoiceSkin is selected and it does not support the currently selected UnitSystem then NavigationManager will default to METRIC. It is recommended that after calling { @link NavigationManager#setVoiceSkin(VoiceSkin) } then { @link NavigationManager#setDistanceUnit(UnitSystem) } be also called to setup the appropriate UnitSystem .

Parameters:

Returns:

NONE if operation was successful, INVALID_OPERATION if the selected VoiceSkin does not support the desired unit system. otherwise one of the other error codes in Error.

See also:

setVoiceSkin(VoiceSkin)

public void setEnabledAudioEvents (java.util.EnumSet <AudioEvent> events)

Used to enable/disable the playback of audio events during navigation. As the presence of an enum will enable the desired event, likewise the absence of an enum will disable the missing event.

Parameters:

public void setMap (Map map)

Set Map to this Navigation Manager object and show the Navigation on Map . Passing null will remove Navigation from the Map . Setting a new Map instance (e.g. setMap(Map1) => setMap(Map2) ) will cause Navigation to be removed from Map1 and added to Map2 .

Note: Setting the map while Navigation is ongoing is not supported.

Parameters:

  • map

    The Map to show the Navigation on.

public Error setMapUpdateMode (MapUpdateMode mode)

Sets the Map Update Mode, different modes changes the way position is updated. The default Map Update Mode is NONE.

Parameters:

Returns:

Any NavigationManager.Error that resulted from the update

public boolean setNaturalGuidanceMode (java.util.EnumSet <NaturalGuidanceMode> mode)

Set the natural guidance modes to be enabled. By default, all of the natural guidance modes are disabled.

Parameters:

  • mode

    One or more natural guidance modes to be enabled

Returns:

True if all modes were set successfully. False otherwise.

public void setRealisticViewMode (RealisticViewMode mode)

Change realistic view mode. By default the feature is off. By selecting day or night (and adding an aspect ratio with addRealisticViewAspectRatio(AspectRatio)) the feature is activated. When the user is approaching a maneuver where realistic view images are available, RealisticViewListener#onJunctionViewShow(NavigationManager.AspectRatio,Image) and on2DSignShow(NavigationManager.AspectRatio, Image) events will be sent.

Parameters:

  • mode

    The mode to set.

Throws:

  • AccessControlException

    Access to this operation is denied. Contact your HERE representative for more information.

public Error setRoute (Route route)

Sets the route navigation manager should use.

Parameters:

  • route

    the new route navigation manager should use

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error. INVALID_PARAMETERS if route is null or is an online public transit, bicycle or online urban mobility route (route with TransportMode set to PUBLIC_TRANSPORT, BICYCLE or calculated using UMRouter). INVALID_OPERATION if LocationDataSourceAutomotive is provided as position source but a non-automotive route is used ( route with TransportMode NOT set to CAR). OPERATION_NOT_ALLOWED if access to this operation is denied.

public Error setRouteRequestInterval (int value)

Set the time period between two re-routing. Default interval is 5 minutes. This time period is applicable when DYNAMIC or MANUAL is in use.

Parameters:

  • value

    The new route request interval in seconds

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.

See also:

setTrafficAvoidanceMode(TrafficAvoidanceMode)

public boolean setSpeedWarningEnabled (boolean value)

Set the speed warning state. The method makes it easy to turn on/off speed warning notifications during the same navigation session. The speed warning is automatically turned on when setSpeedWarningOptions(float, float, float) is called. Operation fails if called before starting navigation, tracking or simulation. Operation also fails when speed warner is not available or is not initialized, (for example, in pedestrian mode). Operation fails if stopSpeedWarning() has already been called for the current navigation session.

Parameters:

  • value

    speed warning state. The boolean value true indicates that the speed warning is going to be turned on. The boolean value false indicates that the speed warning is going to be turned off.

Returns:

true if operation was successful , false otherwise.

public Error setSpeedWarningOptions (float lowSpeedOffset, float highSpeedOffset, float highSpeedBoundary)

Set speed warning options. Speed warning is triggered by comparing current speed to speed limit with offset. i.e. if you exceed the speed limit beyond the given offset a warning will be issued Speed unit is is m/s. Operation fails if called before starting navigation, tracking or simulation. Operation fails when speed warner is not available or is not initialized (eg:in pedestrian mode).

Parameters:

  • lowSpeedOffset

    Offset in low speeds.

  • highSpeedOffset

    Offset in high speeds.

  • highSpeedBoundary

    Boundary for high speed. Above this speed high speed offset is used and below low speed offset.

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.

public Error setTrafficAvoidanceMode (TrafficAvoidanceMode mode)

Set the way in which traffic should be handled during navigation. Default NavigationManager.TrafficAvoidanceMode is DISABLE.

Parameters:

  • mode

    The desired TrafficAvoidanceMode

Returns:

java.lang.Error#NONE if operation was successful, otherwise one of the other error codes in Error.

public void setTtsOutputFormat (TtsOutputFormat format)

Sets the TTS text output format. Default format is RAW (pure text without phonemes and escape sequences).

Parameters:

public Error setVoiceSkin (VoiceSkin skin)

sets the voice skin id for voice Navigation

Parameters:

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.

public Error simulate (Route route, long speed)

Start route simulation.

Route simulation should only be used for testing purposes. Do not use this feature in a production application.

Parameters:

  • route

    The route to use.

  • speed

    simulation speed in meter per second. Valid range is 0 - 4294967295.

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error. INVALID_PARAMETERS if route is null or is an online public transit, bicycle or online urban mobility route (route with TransportMode set to PUBLIC_TRANSPORT, BICYCLE or calculated using UMRouter). INVALID_OPERATION if LocationDataSourceAutomotive is provided as position source but a non-automotive route is used ( route with TransportMode NOT set to CAR). OPERATION_NOT_ALLOWED if access to this operation is denied.

public Error startNavigation (Route route)

Start navigation along the route.

Parameters:

  • route

    The Route to use.

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error. INVALID_PARAMETERS if route is null or is an online public transit, bicycle or online urban mobility route (route with TransportMode set to PUBLIC_TRANSPORT, BICYCLE or calculated using UMRouter). INVALID_OPERATION if LocationDataSourceAutomotive is provided as position source but a non-automotive route is used ( route with TransportMode NOT set to CAR). OPERATION_NOT_ALLOWED if access to this operation is denied.

public Error startTracking ()

Start tracking mode.

Returns:

NONE if operation was successful, otherwise one of the other error codes in Error.

public void stop ()

Abort the current operation, which can be route navigation, route simulation or tracking.

public void stopSpeedWarning ()

Stop speed warning notifications for the current navigation session. After this method call, changing the speed warning state will have no effect during the current navigation session.