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>
此資訊清單項目參照您透過路徑 AppProjectDirectory/app/src/main/res/xml/automotive_app_desc.xml 所建立的另一個 XML 檔案。您可以在該檔案中宣告應用程式支援的 Android Auto 功能。
使用 車輛專用 Android App Library 的應用程式必須在 automotive_app_desc.xml 檔案中宣告 template 功能:
<automotiveApp>
<uses name="template" />
</automotiveApp>
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間: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"]],["上次更新時間:2026-05-02 (世界標準時間)。"],[],[]]