Android Auto extends the Android platform into the car. When users connect their handheld devices running Android 5.0 or higher to a compatible vehicle, the Auto user interface provides a car-optimized Android experience on the vehicle's screen. Users interact with compatible apps and services through voice actions and the vehicle's input controls (like a touchscreen or dashboard buttons).
Auto currently supports two types of apps:
You can enable your existing audio and messaging apps developed for phones and tablets to work in the car, without having to worry about vehicle-specific hardware differences. To enable your app for Auto, your app must target Android 5.0 (API level 21) or higher. Your app’s manifest must also declare the car capabilities that it uses, such as audio playback or messaging services.
This lesson describes how to start building apps for Auto, including setting up your development environment and meeting the the minimum requirements to enable an app to communicate with Auto.
This section describes how to create a new app or modify an existing app to communicate with Auto.
Before you begin building apps for Auto, you must:
targetSdkVersionto 21 or higher.
NotificationCompat.CarExtenderclass contained in the v4 support library. This class allows you to create notifications that are compatible with Auto devices.
The Auto features that your app can access are controlled by the settings in your app manifest and a separate XML configuration file. Before adding Auto features to your app, you must first define the Auto XML configuration file and add a manifest entry referencing your XML file.
Specify the car capabilities that your app uses in an XML file that you
place in your project’s resources directory (
res/xml/). For example, to
extend an audio application for Auto, create a file called
automotive_app_desc.xml and store it under your projects’s
res/xml/ folder. The
automotive_app_desc.xml file contains the
<automotiveApp> <uses name="media" /> </automotiveApp>
<uses> element declares the Auto capability your app
intends to use. Multiple
<uses> tags can be added if your
application uses multiple car capabilities. The
name attribute indicates
the specific capability your app uses. The values supported are:
media- The app uses the Android framework APIs to play music in a vehicle. Set this value if you are enabling an audio app for Auto.
notification- The app displays message notifications in the car’s Overview screen, allows users select a message to be read aloud, and lets them respond through voice input. Set this value if you are enabling a messaging app for Auto.
In your app’s manifest (
AndroidManifest.xml), provide a reference to
the Auto XML configuration file you created in the previous section. Add a
"com.google.android.gms.car.application" metadata entry under the
element that references your Auto XML configuration file. Omit the
file extension when specifying the configuration filename.
The following code snippet shows how to include this reference in your manifest.
<application> ... <meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc"/> </application>
After you have completed the steps described above, you're ready to add Auto features to your apps. See these additional topics to help you build apps for Auto:
Important: Google takes driver distraction very seriously. There are specific design requirements your app must meet to qualify as an Auto app on Google Play. By adhering to these requirements, you can reduce the effort for building and testing your app. For more information, see Auto App Quality.