visit
implementation (‘com.mapbox.mapboxsdk:mapbox-android-sdk:8.4.0@aar’){
transitive=true
}
implementation “com.mapbox.mapboxsdk:mapbox-android-telemetry:4.6.0”
implementation (‘com.mapbox.mapboxsdk:mapbox-android-services:2.2.9@aar’){
transitive=true
}
implementation(“com.mapbox.mapboxsdk:mapbox-android-accounts:0.3.0”) {
force = true
}
api “com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.41.0”
implementation ‘com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.41.0’
implementation “com.mapbox.mapboxsdk:mapbox-android-navigation:0.41.0”
implementation “com.mapbox.mapboxsdk:mapbox-android-core:0.2.1”
implementation files(‘~\\mapbox-android-vision-release.aar’)
implementation files(‘~\\mapbox-android-vision-ar-release.aar’)
implementation files(‘~\\mapbox-android-vision-safety-release.aar’)
Let us first visit our case of Phone Camera
Here, I am setting the static variables like LOCATION_INTERVAL and directionsRoute. Also, I have to set the route_origin and route_destination with their latitudes and longitudes which we have hard-coded here. We can dynamically set the destination location by selecting the destination on the map.Then I started my arLocationEngine. Post which, we declare our onCreate() segment that contains the routeFetcher which uses the MapBox Token inorder to fetch the route.Here, I am setting on the off-route listener, just in case. If we are off-route, we would be able to alter our path based on our current location and VisionManager./ /Route need to be reestablished if off route happens.
mapboxNavigation.addOffRouteListener(this)
mapboxNavigation.addProgressChangeListener(this)
VisionManager.create()
VisionManager.start()
VisionManager.setModelPerformanceConfig(
ModelPerformanceConfig.Merged(
performance = ModelPerformance.On(ModelPerformanceMode.DYNAMIC, ModelPerformanceRate.HIGH)
)
)
VisionArManager.create(VisionManager)
ar_view.setArManager(VisionArManager)
ar_view.onResume()
directionsRoute.let {
if (it == null) {
Toast.makeText(this, “Route is not set!”, Toast.LENGTH_LONG).show()
finish()
} else {
setRoute(it)
}
}
Next, let's look at using an External Camera
For our other use case, where we are using an external camera, I worked with the engineers in the MapBox team to get this done (Jan-Feb 2020), where I happened to suggest a model to them. Here, the external camera is used to capture the video and the same is uploaded into the server. We are fetching the same video through a URL through which we fed into our system again.Refer to the implementation video link below,Kindly refer to my GitHub repository at Thank you for your time and attention, and I would certainly love to have your appreciation! (Credits to Mapbox for their banner Image).Also published at