You need to make a few changes to your app's manifest so that Android Auto can
discover and interact with your app's
Declare Android Auto support
The Android Auto host checks that the app has declared support for Android Auto. To enable this support, include the following entry in your app's manifest:
<application> ... <meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc"/> ... </application>
This manifest entry refers to another XML file that you should create with the
AppProjectDirectory/app/src/main/res/xml/automotive_app_desc.xml where you
declare what Android Auto capabilities your app supports.
Apps using the Android for Cars App Library must declare the
capability in the
<automotiveApp> <uses name="template" /> </automotiveApp>
Set your app's minSdkVersion
Android Auto requires your app to target Android 6.0 (API level 23) or higher.
To specify this value in your project, set the
minSdkVersion attribute in
uses-sdk element to 23 or higher in your phone app module's
AndroidManifest.xml file, as shown in the following example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ... > <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="32" /> ... </manifest>
Running the app on a real head unit
In order for your app to run on a real head unit (not the desktop head unit we provide), your app must be distributed through the Google Play Store. This ensures that your application has been tested and vetted for adherence to our guidelines. These guidelines ensure that your application is relevant to the car environment, as well as pass our driver distraction tests.
For testing while under development, there are three options:
- Using the desktop head unit.
- Pushing your application to a Google Play Store's
internal test track. The internal test track allows you to manually add your team to allow for internal testing. Releases to this track will not require Google Play Store reviews.
- Sharing your application with
internal app sharingin the Google Play Console. Similar to the internal test track, this does not require Google Play Store reviews.