You need to make a few changes to your app's manifest so that Android Auto can discover and interact with your app's media browser service.
Set your app's targetSdkVersion
Android Auto requires your app to target Android 5.0 (API level 21) or higher.
To specify this value in your project, set the targetSdkVersion
attribute in
uses-sdk
element to 21 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="4" android:targetSdkVersion="21" /> ... </manifest>
Declare media support for Android Auto
Use the following manifest entry to declare that your phone app supports Android Auto:
<application>
...
<meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
...
<application>
This manifest entry refers to an XML file that declares what automotive
capabilities your app supports. To indicate that you have a media app, add an
XML file named automotive_app_desc.xml
to the res/xml/
directory in your
project. This file should include the following content:
<automotiveApp>
<uses name="media"/>
</automotiveApp>