一.代码示例地址:
https://github.com/mapbox/mapbox-navigation-android-examples/tree/main
二. 具体步骤:
git clone git@github.com:mapbox/mapbox-navigation-android-examples.git
Go to app/src/main/res/values
Look for mapbox_access_token.xml
If the file already exists, swap YOUR_ACCESS_TOKEN_HERE with your public access token.
If the file doesn't exist then create one and add the following content to it
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"><string name="mapbox_access_token">YOUR_ACCESS_TOKEN_HERE</string>
</resources>
Ensure that your secret token is added to build.gradle or to global gradle.properties as described in the installation guide.
Run the examples under app.