The android-auto-app showcases the minimum integration needed to support the android-auto module in your application, it's a portable example that can be copied into your app. See instructions for integrating below.
- Change "Configuration" of "android-auto-app". "Launch Options - Launch" should be "Nothing"
- Update or create the "mapbox_access_token.xml" under "android-auto-app/src/main/res/values" and put below
<resources xmlns:tools="http://schemas.android.com/tools"> <string name="mapbox_access_token" translatable="false" tools:ignore="UnusedResources">PUBLIC TOKEN HERE</string>
- Establish Android Auto environment by following Google's document or Readme
- Run "android-auto-app" which installs the app on your device
- Run the app on "Desktop Head Unit"
When testing Android Auto, it is easy to simulate a route instead of using mock locations. Follow these instructions, to enable route replay. https://docs.mapbox.com/android/navigation/guides/developer-tools/route-replay/
1. Start the desktop head unit
2. Open your navigation app
3. $ adb shell dumpsys activity service com.mapbox.navigation.examples.androidauto.car.MainCarAppService AUTO_DRIVE