Google Play was providing a warning that our app does not handle voice commands. So now you can navigate with audio. To test it with the desktop head unit, use the mic begin command.
./desktop-head-unit
> mic begin
** speak "Navigate to coffee"
Show markers and current location place list map view.
Before
After
Refactor
MapboxNavigationProvider can have issues because a previous version of MapboxNavigation will be destroyed. This results in a common crash "Fatal Exception: java.lang.IllegalStateException: This instance of MapboxNavigation is destroyed."
Instead of accessing MapboxNavigation through MapboxNavigation.retrieve(), this is making it so we can access MapboxNavigation through services with a lifecycle.
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
// Required in order to use `MapboxNavigationApp`
MapboxNavigationApp.setup(this, MyMapboxNavigationInitializer())
// Application level services
MapboxNavigationApp.registerObserver(MyHistoryLifecycleObserver())
MapboxNavigationApp.registerObserver(MyReplayLifecycleObserver())
// Setup android auto after you set up MapboxNavigationApp
MapboxCarApp.setup(this, ExampleCarInitializer())
class MyNavigationInitializer : MapboxNavigationInitializer {
override fun create(application: Application): NavigationOptions {
// Allows you to customize `NavigationOptions`
}
}
class MyHistoryLifecycleObserver : MapboxNavigationObserver {
private lateinit var history: ExampleHistoryRecorder
override fun onAttached(mapboxNavigation: MapboxNavigation) {
history = getKoin().get(ExampleHistoryRecorder::class)
history.startRecording(mapboxNavigation)
}
override fun onDetached(mapboxNavigation: MapboxNavigation?) {
history.stopAndUploadHistory(mapboxNavigation)
}
}
Features
Navigate with voice commands
GeoDeeplinkParser
GeoDeeplinkGeocoding
,GeoDeeplinkNavigateAction
GeoDeeplinkPlacesListOnMapProvider
Google Play was providing a warning that our app does not handle voice commands. So now you can navigate with audio. To test it with the desktop head unit, use the
mic begin
command.https://user-images.githubusercontent.com/3021882/141598723-e8efab90-ffa8-441c-9544-e54052d5816f.mov
Fixes
Show markers and current location place list map view.
Refactor
MapboxNavigationProvider
can have issues because a previous version ofMapboxNavigation
will be destroyed. This results in a common crash "Fatal Exception: java.lang.IllegalStateException: This instance of MapboxNavigation is destroyed."Instead of accessing
MapboxNavigation
throughMapboxNavigation.retrieve()
, this is making it so we can accessMapboxNavigation
through services with a lifecycle.