設定資訊清單檔案
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
設定應用程式的資訊清單檔案,與 Android Auto 和 Android Automotive OS (AAOS) 整合。如要讓這些平台探索及連線,請在資訊清單中宣告媒體瀏覽器服務。指定必要的應用程式圖示,包括啟動器圖示,以及供媒體控制項等系統 UI 元件使用的出處圖示。
如要進一步瞭解資訊清單檔案,請參閱「應用程式資訊清單總覽」。
宣告媒體瀏覽器服務
Android Auto 和 AAOS 都是透過媒體瀏覽器服務連結至您的應用程式,以便瀏覽媒體項目。在資訊清單中宣告媒體瀏覽器服務,讓 Android Auto 和 AAOS 探索服務並連線至您的應用程式。
下列程式碼片段說明如何在資訊清單中宣告媒體瀏覽器服務。請將此程式碼加入 AAOS 模組的資訊清單檔案,以及手機應用程式的資訊清單檔案。
<application>
...
<service android:name=".MyMediaBrowserService"
android:exported="true">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService"/>
</intent-filter>
</service>
...
</application>
指定應用程式圖示
如要在系統 UI 中代表您的應用程式,請指定 Android Auto 和 AAOS 應使用的應用程式圖示。您必須提供以下兩種圖示:
定義啟動器圖示
啟動器圖示會在系統 UI 中代表您的應用程式,例如在啟動器和圖示匣上。您可以使用下列資訊清單宣告,指明您想要使用行動應用程式中的圖示,來代表您的汽車媒體應用程式:
<application
...
android:icon="@mipmap/ic_launcher"
...
/>
如要使用與行動應用程式不同的圖示,請在媒體瀏覽器服務的資訊清單中,設定 <service>
元素的 android:icon
屬性:
<application>
...
<service
...
android:icon="@mipmap/auto_launcher"
...
/>
</application>
定義出處圖示
出處圖示會用在媒體內容優先播放的位置,例如媒體資訊卡。建議您重複使用通知所用的小圖示。這個圖示必須是單色。

圖 1. 媒體資訊卡上的出處圖示。
您可以使用下列資訊清單宣告,指定用來代表應用程式的圖示:
<application>
...
<meta-data
android:name="androidx.car.app.TintableAttributionIcon"
android:resource="@drawable/ic_status_icon" />
...
</application>
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-22 (世界標準時間)。
[null,null,["上次更新時間:2025-08-22 (世界標準時間)。"],[],[],null,["# Configure manifest files\n\nConfigure your app's manifest files to integrate with Android Auto and Android\nAutomotive OS (AAOS). To enable discovery and connection by these platforms,\ndeclare your media browser service in the manifest. Specify the required app\nicons, including a launcher icon for an attribution\nicon for use by system UI components such as media controls.\n\nTo learn more about manifest files, see [App manifest overview](/guide/topics/manifest/manifest-intro).\n\nDeclare your media browser service\n----------------------------------\n\nAndroid Auto and AAOS connect to your app through your media browser service to\nbrowse media items. Declare your media browser service in your manifest to let\nAndroid Auto and AAOS discover the service and connect to your app.\n\nThis code snippet shows how to declare your media browser service in your\nmanifest. The next section of this guide, [Create a media browser service](/training/cars/media/create-media-browser),\ndetails the process of implementing the service. \n\n \u003capplication\u003e\n ...\n \u003cservice android:name=\".MyMediaBrowserService\"\n android:exported=\"true\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.media.browse.MediaBrowserService\"/\u003e\n \u003c/intent-filter\u003e\n \u003c/service\u003e\n ...\n \u003c/application\u003e\n\n| **Caution:** You might see a lint warning because the service is exported, but doesn't set the [`android:permission`](/guide/topics/manifest/service-element#prmsn) attribute. It's generally safe to ignore this warning because you can [Add package validation](/training/cars/media/create-media-browser/content-hierarchy#package-validation), which provides more control over which host apps can connect to your app.\n\nSpecify app icons\n-----------------\n\nTo represent your app in the system UI, specify the app icons that Android Auto\nand AAOS should use. These two icons are required:\n\n- [Define the launcher icon](#launcher-icon)\n- [Define the attribution icon](#attribution-icon)\n\n| **Design guidelines:** [Branding elements](/design/ui/cars/guides/app-cuj/branding-elements).\n\n### Define the launcher icon\n\nThe launcher icon represents your app in the system UI, such as on the launcher\nand in the tray of icons.\n\nBy default, the [`android:icon`](/guide/topics/manifest/application-element#icon) attribute of your app's\n[`\u003capplication\u003e`](/guide/topics/manifest/application-element) element is used as the launcher icon: \n\n \u003capplication\n ...\n android:icon=\"@mipmap/ic_launcher\"\n \u003e\n\nTo use a different icon, set the `android:icon` attribute of your media browser\nservice's [`\u003cservice\u003e`](/guide/topics/manifest/service-element) element: \n\n \u003capplication\u003e\n ...\n \u003cservice\n ...\n android:icon=\"@mipmap/ic_car_launcher\"/\u003e\n \u003c/application\u003e\n\n### Define the attribution icon\n\nThe attribution icon is used in places where media content takes precedence,\nsuch as on media cards. Consider reusing the small icon used for notifications.\nThis icon must be monochrome.\n\n**Figure 1.** Attribution icon on media card.\n\nYou can specify an icon that is used to represent your app using this manifest\ndeclaration: \n\n \u003capplication\u003e\n ...\n \u003cmeta-data\n android:name=\"androidx.car.app.TintableAttributionIcon\"\n android:resource=\"@drawable/ic_status_icon\" /\u003e\n ...\n \u003c/application\u003e\n\nSpecify your app's label\n------------------------\n\nBy default, the value of the [`android:label`](/guide/topics/manifest/application-element#label) attribute of your app's\n`\u003capplication\u003e` element is used as the display name for your app on the car\nscreen.\n\nTo use a different display name -- or if your app has multiple media browser\nservices -- set the `android:label` attribute of the media browser service's\n`\u003cservice\u003e` element.\n\nSpecify your app's accent color\n-------------------------------\n\nYour app's accent color is used by Android Auto and AAOS to style playback\ncontrols and other UI elements.\n\nBy default, the accent color is pulled from the [`colorAccent`](/reference/android/R.attr#colorAccent) item of the\n[`android:theme`](/guide/topics/manifest/application-element#theme) style resource of your app's `\u003capplication\u003e` element.\n\nTo use a different accent color for your in-car experience, include a\n[`\u003cmeta-data\u003e`](/guide/topics/manifest/meta-data-element) element for a different style resource containing a\n`colorAccent` item: \n\n \u003capplication\u003e\n ...\n \u003cmeta-data\n android:name=\"com.google.android.gms.car.application.theme\"\n android:resource=\"@style/\u003cvar translate=\"no\"\u003eTHEME_NAME\u003c/var\u003e\"/\u003e\n ...\n \u003c/application\u003e\n\nPlatform-specific configuration\n-------------------------------\n\nIn addition to the configuration detailed on this page, see the following\nsections for platform-specific requirements:\n\n- [Add support for Android Auto to your media app](/training/cars/media/auto#manifest-car-app)\n- [Add support for Android Automotive OS to your media app](/training/cars/media/automotive-os#automotive-module)"]]