Package com.navmii.android.dashcamsdk
Class DashcamSdk
- java.lang.Object
-
- com.navmii.android.dashcamsdk.DashcamSdk
-
public class DashcamSdk extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDashcamSdk.ConfigurationSettingsThis class contains the configuration settings required to initialize the SDK.static interfaceDashcamSdk.DayNightChangeListenerThe listener that will be notified when the change between day and night happens at the current GPS position.static classDashcamSdk.InitializationErrorThis class contains information about an SDK initialization error.static interfaceDashcamSdk.PositionListenerThe listener that will be notified about events related to the current GPS position.static interfaceDashcamSdk.StateChangeListenerThe listener that will be notified about changes of the SDK's state.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDayNightChangeListener(DashcamSdk.DayNightChangeListener listener)Adds a listener that will be notified when the change between day and night happens at the current GPS position.voidaddPositionListener(DashcamSdk.PositionListener listener)Adds a listener that will be notified about events related to the current GPS position.voidaddStateChangeListener(DashcamSdk.StateChangeListener listener)Adds a listener that will be notified when the current state of the SDK changes.voiddeinitializeSdk()Deinitializes the SDK.AdasControllergetAdasController()CameraControllergetCameraController()java.lang.StringgetCurrentCountryIso3Code()android.location.LocationgetCurrentPosition()java.lang.StringgetCurrentRoadName()intgetCurrentSpeedLimit()DashcamSdk.InitializationErrorgetInitializationError()static DashcamSdkgetInstance()Returns the instance of the dashcam SDK.LibraryManagergetLibraryManager()DashcamSdkStategetState()static intgetVersionCode()static java.lang.StringgetVersionName()voidinitSdkAsync(android.content.Context context, DashcamSdk.ConfigurationSettings configurationSettings)Initializes the SDK.voidremoveDayNightChangeListener(DashcamSdk.DayNightChangeListener listener)Removes the specified day/night change listener.voidremovePositionListener(DashcamSdk.PositionListener listener)Removes the specified position listener.voidremoveStateChangeListener(DashcamSdk.StateChangeListener listener)Removes the specified state change listener.
-
-
-
Method Detail
-
getInstance
public static DashcamSdk getInstance()
Returns the instance of the dashcam SDK.- Returns:
- The
DashcamSdkobject.
-
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.
-
deinitializeSdk
public void deinitializeSdk()
Deinitializes the SDK.Use this method to release all resources used by the SDK.
If state is
DashcamSdkState.INITIALIZING, then actual deinitialization will be postponed until initialization finishes (successfully or not). In these cases SDK will skipDashcamSdkState.INITIALIZEDorDashcamSdkState.INITIALIZATION_FAILEDstates, going directly toDashcamSdkState.UNINITIALIZEDstate.
-
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.
-
getLibraryManager
public LibraryManager getLibraryManager()
- Returns:
- An instance of a
LibraryManagerobject.
-
getCameraController
public CameraController getCameraController()
- Returns:
- An instance of a
CameraControllerobject.
-
getAdasController
public AdasController getAdasController()
- Returns:
- An instance of an
AdasControllerobject.
-
-