Add support for Android Auto to your templated app

Review the following information to learn how make changes to your app's manifest so that Android Auto can discover and interact with your app's CarAppService.

Declare Android Auto support

The Android Auto host checks whether 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 create with the path AppProjectDirectory/app/src/main/res/xml/automotive_app_desc.xml. In that file, you declare what Android Auto capabilities your app supports.

Apps using the Android for Cars App Library must declare the template capability in the automotive_app_desc.xml file:

<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 the 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="34" />
    ...
</manifest>