This is a Flutter plugin for the Vietmap Automotive SDK, which help you to integrate Vietmap turn by turn Navigation SDK into your Flutter app, included Android Auto and Apple CarPlay.
- Add the plugin to your
pubspec.yaml
file.
dependencies:
vietmap_automotive_flutter: ^0.0.2
- Import Android auto module to bottom of your
setting.gradle
file (top level function). ReplaceVIETMAP_AUTOMOTIVE_FLUTTER_VERSION
with the latest version of the plugin.:
def relativePath = ""
settingsDir.eachDir { subDir ->
if(subDir.name == "app"){
def pathComponents =settingsDir.absolutePath.split('/')
def rPath = ""
pathComponents.each { component ->
rPath += '../'
}
relativePath = rPath.substring(9, rPath.length())
}
}
include ':androidauto'
project(':androidauto').projectDir = file("${relativePath}.pub-cache/hosted/pub.dev/vietmap_automotive_flutter-VIETMAP_AUTOMOTIVE_FLUTTER_VERSION/android/androidauto")
- Import Android auto module to your
build.gradle
(module app) file:
dependencies {
implementation project(':androidauto')
}
- Add below maven url to your
build.gradle
(project) andsetting.gradle
file:
maven { url = uri("https://www.jitpack.io" ) }
Like this
- build.gradle
allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://www.jitpack.io" ) }
}
}
- setting.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://www.jitpack.io" ) }
}
}
- Add below permission to your
AndroidManifest.xml
file:
<uses-permission android:name="androidx.car.app.MAP_TEMPLATES" />
<uses-permission android:name="androidx.car.app.NAVIGATION_TEMPLATES" />
<uses-permission android:name="androidx.car.app.ACCESS_SURFACE" />
- Add the following metadata to the AndroidManifest.xml file of the
app
(Inside the application tag)
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
For test the app, please follow below document:
More information about the Vietmap Automotive SDK can be found at Vietmap Automotive SDK.