Date: Thu, 28 Mar 2024 10:09:08 +0000 (UTC) Message-ID: <1288089060.77.1711620548962@4f0436399eb0> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_76_1050772571.1711620548962" ------=_Part_76_1050772571.1711620548962 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The SDK supports Android version 5.0 ("Lollipop", API level 21) or highe= r and the following ABIs:
armeabi-v7a
arm64-v8a
Specify the repositories in settings.gradle
(or in bu=
ild.gradle
, if you are using an older version of Android Gradle plug=
in):
depen= dencyResolutionManagement { =09repositories { =09 maven { =09 url 'https://maven.navmii.com/artifactory/navmii-public' =09 credentials { =09 username "public" =09 password "public1&" =09 } =09 } =09 maven { =09 url 'https://repository.apache.org/content/repositories/snapshot= s/' =09 } =09} }
Add the following lines to your app's build.gradle
:
andro= id { =09compileOptions { =09 // Flag to enable support for the new language APIs coreLibraryDesugaringEnabled true sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' =09implementation 'com.navmii.android:dashcam-sdk:1.2.2.178' }
If you want to always use the latest version of the SDK, you can specify= a dynamic version instead of a fixed one. For example:
depen= dencies { implementation 'com.navmii.android:dashcam-sdk:1.+' }
Add the following lines to the AndroidManifest.xml
of your =
application within the <application></application>
=
block:
<meta= -data android:name=3D"com.navmii.sdk.API_KEY" android:value=3D"<YOUR_API= _KEY>" />
Add the following lines to the AndroidManifest.xml
within t=
he <manifest></manifest>
block:
<uses= -permission android:name=3D"android.permission.CAMERA" /> <uses-permission android:name=3D"android.permission.INTERNET" /> <uses-permission android:name=3D"android.permission.ACCESS_COARSE_LOCATI= ON" /> <uses-permission android:name=3D"android.permission.ACCESS_FINE_LOCATION= " /> <uses-permission android:name=3D"android.permission.ACCESS_NETWORK_STATE= " /> <uses-feature android:glEsVersion=3D"0x00020000" android:required=3D"tru= e" /> <uses-feature android:name=3D"android.hardware.camera" android:required= =3D"true" /> <uses-feature android:name=3D"android.hardware.camera.autofocus" android= :required=3D"false" /> <uses-feature android:name=3D"android.hardware.location.gps" android:req= uired=3D"true" />
If you want to record audio, also add the following permission:
<uses= -permission android:name=3D"android.permission.RECORD_AUDIO" />
After requesting the required permissions from user as described here, you can initialize the SDK using=
initSdkAsync
method:
... val requestPermissionLauncher =3D registerForActivityResult( ActivityResultContracts.RequestMultiplePermissions() ) { result: Map<String, Boolean> -> for ((permission, isGranted) in result) { if (!isGranted) { return@registerForActivityResult } } val settings =3D DashcamSdk.ConfigurationSettings.builder() .setLibraryLocation(DocumentFile.fromFile(getExternalFilesDir(n= ull)!!)) .build() DashcamSdk.getInstance().addStateChangeListener { state -> Log.d("MainActivity", "SDK state: $state, error: ${DashcamSdk.g= etInstance().initializationError}") } DashcamSdk.getInstance().initSdkAsync(this, settings) } ... override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ... requestPermissionLauncher.launch(arrayOf( Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION)) }
Please follow the link below for the API reference
https://navmii-api-reference.s3.eu-west-1.amazonaws.com/dashcam-sdk/Andr= oid/1.2.2.178/index.html