On devices running Android 15 or higher, Android Auto supports running apps in supported parked app categories directly on the head unit. See Parked apps for more information about the parked app user experience on Android Auto.
Declare Android Auto support
To declare that your app supports Android Auto, you must include the following
<category>
element in the intent filter of an activity in your app's manifest:
<activity ...>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
...
<category android:name="android.intent.category.CAR_LAUNCHER" />
</intent-filter>
</activity>
Generally, the android.intent.category.CAR_LAUNCHER
category element can
be placed in the same intent filter as the android.intent.category.LAUNCHER
element, but it can be in a different one if preferred.
Category-specific manifest entries
In addition to the preceding requirement, games have an additional requirement. See Mark your app as a game.
Support common Android Auto screen sizes
For the best user experience, we recommend making your app fully adaptive
to different screen sizes. At the minimum, to ensure a high quality experience
in the variety of cars that support Android Auto, apps must not be
significantly pillarboxed on landscape screens, as captured by the DO-2
car app quality guideline.
For example, if an app runs in a portrait aspect ratio with pillarboxing on a landscape screen, it will be rejected during Play Store review. An app running in a landscape aspect ratio with minimal pillarboxing on a landscape screen is acceptable, as is an app running in a landscape aspect ratio with letterboxing on a portrait screen.
Test against canonical screen sizes
When building and testing your app for Android Auto, you can use the following Desktop Head Unit (DHU) configurations to verify that your app meets the preceding requirements:
Small Landscape
[general]
resolution = 800x480
dpi = 160
...
Wide Landscape
[general]
resolution = 1920x1080
dpi = 160
marginheight = 596
normalizedpi = true
cropmargins = true
...
Portrait
[general]
resolution = 1920x1080
dpi = 160
marginwidth = 878
normalizedpi = true
cropmargins = true
...
Detect usage on Android Auto
If you'd like to detect when your app is being used through Android Auto (such as for analytics purposes), you can look at two signals:
- The connection state reported by the
CarConnection
API. When Android Auto is connected, this will beCONNECTION_TYPE_PROJECTION
. - The display ID of the active display. When your app is running on a display
other than a built-in screen, such as when used through Android Auto, this is
a value other than
DEFAULT_DISPLAY
.
The following snippet shows how to combine these signals to detect usage through Android Auto:
val connectionType = ...
val displayId = context.display.displayId
isRunningOnAndroidAuto = connectionType == CONNECTION_TYPE_PROJECTION and displayId != DEFAULT_DISPLAY