The repository is a collection of examples showing off the Mapbox Navigation Android SDK. In order to support minSdkVersion 21, Android Auto and preview features, there are three example apps.
- app minSdkVersion of 21
- app-preview minSdkVersion of 21
- android-auto-app minSdkVersion of 23
Make sure you follow the steps under the Installation guide. Once you have your public and secret access tokens ready, do the following:
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
.
If you're looking for code examples from previous versions of the Navigation SDK, you can access them through the following links:
- Navigation SDK v2: https://github.com/mapbox/mapbox-navigation-android-examples/tree/main-v2
- Navigation SDK v1: https://github.com/mapbox/mapbox-navigation-android/tree/v1.6.0/examples/
- Have a bug to report? Open an issue. If possible, include the version of Mapbox Navigation SDK, and an example that shows the issue.
- Have an example request? Open an issue. Tell us what the example should do and why you want it.
We welcome feedback and code contributions! Please see CONTRIBUTING.md for details.