Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
向模板化应用添加对 Android Auto 的支持
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
请阅读以下信息,了解如何更改应用的清单,使 Android Auto 能够发现应用的 CarAppService 并与之交互。
声明 Android Auto 支持
Android Auto 主机会检查应用是否已声明支持 Android Auto。如需启用此支持,请在应用的清单中添加以下条目:
<application>
...
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc"/>
...
</application>
此清单条目引用您创建的另一个 XML 文件,其路径为 AppProjectDirectory/app/src/main/res/xml/automotive_app_desc.xml。
在该文件中,您应对应用支持的 Android Auto 功能进行声明。
使用 Android for Cars 应用库的应用必须在 automotive_app_desc.xml 文件中声明 template 功能:
<automotiveApp>
<uses name="template" />
</automotiveApp>
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2026-05-02。
[[["易于理解","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):2026-05-02。"],[],[]]