在媒體應用程式中新增對 Android Auto 的支援
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
您必須對應用程式的資訊清單稍做變更,才能讓 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 檔案會宣告應用程式支援的汽車功能。如要表示您有提供媒體應用程式,請在專案的 res/xml/
目錄中新增名為 automotive_app_desc.xml
的 XML 檔案。此檔案應包含下列內容:
<automotiveApp>
<uses name="media"/>
</automotiveApp>
回報 Android Auto 媒體相關問題
如果您在開發適用於 Android Auto 的媒體應用程式時遇到問題,可以使用 Google Issue Tracker 回報問題。在問題範本中,請務必填寫所有必要資訊。
建立新問題
提交新問題之前,請確認已回報的問題清單中是否已包含該問題。您可以在 Issue Tracker 中按下問題的星號,就能訂閱該問題並投下一票。詳情請參閱訂閱問題一文。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-27 (世界標準時間)。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[],[],null,["You need to make a few changes to your app's manifest so that Android Auto\ncan discover and interact with your app's media browser service.\n| **Important:** This guide assumes that you have already [built a media browser service](/training/cars/media#implement_browser) and you want to add support for Android Auto to your existing project. If you are new to app development for cars, see the [Android for Cars overview page](/training/cars).\n\nDeclare media support for Android Auto\n\nUse the following manifest entry to declare that your phone app supports\nAndroid Auto: \n\n \u003capplication\u003e\n ...\n \u003cmeta-data android:name=\"com.google.android.gms.car.application\"\n android:resource=\"@xml/automotive_app_desc\"/\u003e\n ...\n \u003c/application\u003e\n\nThis manifest entry refers to an XML file that declares what automotive\ncapabilities your app supports. To indicate that you have a media app, add an\nXML file named `automotive_app_desc.xml` to the `res/xml/` directory in your\nproject. This file should include the following content: \n\n \u003cautomotiveApp\u003e\n \u003cuses name=\"media\"/\u003e\n \u003c/automotiveApp\u003e\n\nReport an Android Auto Media issue\n\nIf you run into an issue while developing your media app for Android Auto, you\ncan report it using the\n[Google Issue Tracker](https://issuetracker.google.com/issues?q=status:open%20componentid:192643).\nBe sure to fill out all the requested information in the issue template.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=192643)\n\nBefore filing a new issue, please check whether it is already reported in the issues\nlist. You can subscribe to and vote for issues by clicking the star for an issue in\nthe tracker. For more information, see\n[Subscribing to an Issue](https://developers.google.com/issue-tracker/guides/subscribe#starring_an_issue)."]]