Package 

Interface NavigationSession

  • All Implemented Interfaces:

    
    public interface NavigationSession
    
                        

    This class allows the user to set up specific parameters for the current navigation session. The user can start, stop, simulate a navigation, update the route, attach audio guidance, \ ADAS or alert services.

    !!! APIs in this class are syncronous !!! DO NOT CALL ANY API form NavigationSession in the same callback function receiving navigation status updates. Since all APIs of of NavigationSession are synchronous, calling any of them in the same callback function will cause the internal session working thread hang

    • Constructor Detail

    • Method Detail

      • updateRouteInfo

         abstract int updateRouteInfo(@NonNull() Route route)

        Update route info. !!! This is a synchronous API. This API can be called before and after navigation session is started.

        Thread safety of this api can be ensured by enabling synchronization setEnabled.

        Parameters:
        route - route info, may contain route and guidance
      • startNavigation

         abstract int startNavigation()

        Start navigation !!! This is a synchronous API.

        This API __MUST__ be called after external services are attached to session.

      • startSimulateNavigation

         abstract int startSimulateNavigation()

        Start simulating navigation !!! This is a synchronous API.

        This API __MUST__ be called after external services are attached to session.

      • stopNavigation

         abstract int stopNavigation()

        Stop navigation !!! This is a synchronous API.

      • setSimulateNavSpeed

         abstract void setSimulateNavSpeed(double speed)

        Updates simulate speed. !!! This is a synchronous API. This API __MUST__ be called after position engine has been attached to take effect.

        Parameters:
        speed - speed expressed in unit of meter/second.
      • addListener

         abstract void addListener(@NonNull() NavigationSessionListener listener)

        Requesting this API will add a listener for the current navigation session.

        !!! This is a synchronous API. !!! DO NOT CALL ANY API form NavigationSession in the same callback function receiving navigation status updates. Since all APIs of of NavigationSession are synchronous, calling any of them in the same callback function will cause the internal session working thread hang

        This API __COULD__ be called at any time.

        Parameters:
        listener - session listener
      • removeListener

         abstract void removeListener(@NonNull() NavigationSessionListener listener)

        Remove listener for session !!! This is a synchronous API.

        This API __COULD__ be called at any time.

        Parameters:
        listener - session listener
      • acceptBetterRoute

         abstract void acceptBetterRoute(@NonNull() String id, boolean accepted)

        Accept better route by id.

        Parameters:
        id - better route notification id.
        accepted - accept status
      • setMinTimeSavedPercentage

         abstract void setMinTimeSavedPercentage(int percentage)
        Parameters:
        percentage - percentage of saved travel time,The default value is 10.
      • setShieldIconSize

         abstract void setShieldIconSize(int width, int height)

        Set the width and height of shield icon

        Parameters:
        width - image width in pixel, default value is 40
        height - image height in pixel, default value is 40
      • dispose

         abstract void dispose()

        Frees all resources. Makes references null, removes listeners, calls the underlying C++ layer in order to destroy the C++ objects.

        !!!This is a synchronous API.

        Thread safety of this api can be ensured by enabling synchronization setEnabled.

      • enableLock

         abstract void enableLock(boolean isEnabled)

        Enables synchronization of possible long running navigation APIs with the dispose API. This ensures that if a navigation API is called on a thread before dispose API is called on a different thread the disposing does not start until the former API finishes it's execution, preventing NavigationSessionsException to be thrown due to INSTANCE_DISPOSED cause.

        By default synchronization is disabled.

        !!!This is a synchronous API.
        Parameters:
        isEnabled - true if the synchronization should be enabled, false otherwise.