Android Auto 提供针对驾驶员优化的应用体验,面向拥有安装了 Android Auto 应用的 Android 手机以及兼容的汽车或零件市场立体音响系统的用户,方便他们通过连接手机直接在汽车显示屏上使用您的应用。您可以创建 Android Auto 使用的服务,让 Android Auto 能够连接您的手机应用,以向驾驶员显示已为他们优化的界面。
应用如何声明支持 Android Auto
应用会以不同的方式声明其支持 Android Auto,具体取决于其类别。
媒体、即时通讯和模板应用
媒体、即时通讯和模板化应用通过在清单中添加以下 <meta-data> 元素来声明对 Android Auto 的支持:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-06-10。"],[],[],null,["# Android Auto overview\n\n**Figure 1**: Android Auto\n\nAndroid Auto provides a driver-optimized app experience for users who have an\nAndroid phone with the Android Auto app and a compatible [car or aftermarket\nstereo system](https://www.android.com/auto/compatibility/). They\ncan use your app directly on their car's display by connecting their phone. You\nenable Android Auto to connect with your phone app by creating services that\nAndroid Auto uses to display a driver-optimized interface to the driver.\n| **Note:** Android Auto is only compatible with phones running Android 9 (API level 28) or higher.\n\nHow apps declare support for Android Auto\n-----------------------------------------\n\nApps declare that they support Android Auto in different ways depending on their category.\n\n### Media, Messaging, and templated apps\n\nMedia, Messaging, and templated apps declare support for Android Auto by\nincluding the following `\u003cmeta-data\u003e` element in their manifest: \n\n \u003capplication\u003e\n ...\n \u003cmeta-data\n android:name=\"com.google.android.gms.car.application\"\n android:resource=\"@xml/automotive_app_desc\"/\u003e\n ...\n \u003c/application\u003e\n\nThe contents of the resource file vary depending on your app's category: \n\n### Media\n\n```xml\n\u003cautomotiveApp\u003e\n \u003cuses name=\"media\" /\u003e\n\u003c/automotiveApp\u003e\n \n```\n\n\nSee [Add support for\nAndroid Auto to your media app](/training/cars/media/auto#manifest-car-app) for more details.\n\n### Messaging\n\n```xml\n\u003cautomotiveApp\u003e\n \u003cuses name=\"notification\" /\u003e\n \u003c!-- Include the following only if your capp can be set as the default SMS handler --\u003e\n \u003cuses name=\"sms\"\u003e\n\u003c/automotiveApp\u003e\n \n```\n\n\nSee [Build messaging\napps for Android Auto](/training/cars/messaging#manifest-messaging) for more details.\n\n### Templated apps\n\n```xml\n\u003cautomotiveApp\u003e\n \u003cuses name=\"template\" /\u003e\n\u003c/automotiveApp\u003e\n \n```\n\n\nSee [Add support for Android Auto to your templated app](/training/cars/apps/android-auto#declare-android-auto-support) for more details.\n\n### Parked apps\n\nParked apps declare support for Android Auto by including the following\n`\u003ccategory\u003e` element in the intent-filter of an activity in your app's manifest: \n\n \u003cactivity ...\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n ...\n \u003ccategory android:name=\"android.intent.category.CAR_LAUNCHER\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/activity\u003e\n\nSee [Add support for Android Auto to your parked app](/training/cars/parked/auto) for more details.\n\nParked apps\n-----------\n\nOn devices running Android 15 or higher, Android Auto supports running\nactivities directly on the head unit while parked. This capability is limited to\napps in the [supported parked app categories](/training/cars#parked). For safety purposes, Android\nAuto automatically exits an app when vehicle motion is detected.\n\n### User interface\n\n**Figure 2**: An app running on Android Auto with the back and exit controls shown.\n\nActivities run on Android Auto are always run in full screen. Users can swipe\nfrom the top or bottom edge of the Android Auto UI to pull up controls for\nnavigating back or exiting the current app.\n\n### Behavior differences\n\nDue to restrictions imposed by Android Auto and Android more generally, there\nare some notable behavior differences when an app runs on the head unit.\n\n#### Starting other apps\n\nBecause only apps in supported categories that have declared support for Android\nAuto can have their activities run on the head unit, it is likely that intents\nto other apps won't open the other app on the head unit. If the intent is for a\nweb page or Google Play Store page, the corresponding app will be opened on the\nphone instead. All other activity-launching intents are blocked and the user is\nnotified that the corresponding app can't be opened.\n\n#### Accepting permissions\n\nOn devices running Android 15, it isn't possible for users to accept\nruntime permissions requests on the head unit. When an app requests a\npermission, a dialog appears informing users to accept the permission on their\nphone screen.\n\nTrusted stores\n--------------\n\nAs described in [Test in real vehicles](/training/cars/testing#real-vehicles),\napps must be installed from a trusted source to run on a real vehicle. Trusted\nsources include the following:\n\n- Google Play\n- ONE store\n\nFrequently asked questions\n--------------------------\n\n### How can I detect if Android Auto is running?\n\nTo detect whether Android Auto is running on a device, you can use the\n`CarConnection` API that is part of the Android for Cars App Library. See\n[Connection API](/training/cars/apps#car-connection) for more details.\n| **Caution:** On devices running Android 12 or higher, Android Auto doesn't change the [UI mode](/reference/android/content/res/Configuration#uiMode) of the device when running, so don't rely on it.\n\n### In which vehicles is Android Auto available?\n\nSee the list of [compatible vehicles and stereos](https://www.android.com/auto/compatibility/vehicles/).\n\n### In which countries is Android Auto available?\n\nSee [Is Android Auto available in my country?](https://www.android.com/auto/#al-faq)"]]