Class DashcamSdk


  • public class DashcamSdk
    extends java.lang.Object
    • Method Detail

      • getInstance

        public static DashcamSdk getInstance()
        Returns the instance of the dashcam SDK.
        Returns:
        The DashcamSdk object.
      • getVersionName

        public static java.lang.String getVersionName()
      • getVersionCode

        public static int getVersionCode()
      • initSdkAsync

        public void initSdkAsync​(android.content.Context context,
                                 DashcamSdk.ConfigurationSettings configurationSettings)
        Initializes the SDK.

        This method should be called one time to initialize the SDK (normally on application startup).

        The process of initialization is asynchronous. Use addStateChangeListener(StateChangeListener) to be notified when initialization has been finished.

        Parameters:
        context - The context.
        configurationSettings - The configuration settings.
      • getInitializationError

        @Nullable
        public DashcamSdk.InitializationError getInitializationError()
        Returns:
        The error that occurred during initialization of the SDK or null if initialization completed successfully.
      • getState

        public DashcamSdkState getState()
        Returns:
        The current state of the SDK.
      • addPositionListener

        public void addPositionListener​(DashcamSdk.PositionListener listener)
        Adds a listener that will be notified about events related to the current GPS position.
        Parameters:
        listener - The listener.
      • removePositionListener

        public void removePositionListener​(DashcamSdk.PositionListener listener)
        Removes the specified position listener.
        Parameters:
        listener - The listener.
      • addStateChangeListener

        public void addStateChangeListener​(DashcamSdk.StateChangeListener listener)
        Adds a listener that will be notified when the current state of the SDK changes.
        Parameters:
        listener - The listener.
      • removeStateChangeListener

        public void removeStateChangeListener​(DashcamSdk.StateChangeListener listener)
        Removes the specified state change listener.
        Parameters:
        listener - The listener.
      • addDayNightChangeListener

        public void addDayNightChangeListener​(DashcamSdk.DayNightChangeListener listener)
        Adds a listener that will be notified when the change between day and night happens at the current GPS position.
        Parameters:
        listener - The listener.
      • removeDayNightChangeListener

        public void removeDayNightChangeListener​(DashcamSdk.DayNightChangeListener listener)
        Removes the specified day/night change listener.
        Parameters:
        listener - The listener.
      • getCurrentPosition

        @Nullable
        public android.location.Location getCurrentPosition()
        Returns:
        Current position.
      • getCurrentRoadName

        public java.lang.String getCurrentRoadName()
        Returns:
        The name of current road.
      • getCurrentSpeedLimit

        public int getCurrentSpeedLimit()
        Returns:
        Current speed limit in km/h, or 0 if there is no speed limit.
      • getCurrentCountryIso3Code

        public java.lang.String getCurrentCountryIso3Code()
        Returns:
        ISO3 code of current country or an empty string if current country cannot be determined.