テンプレート アプリに 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 アプリ ライブラリを使用するアプリは、automotive_app_desc.xml
ファイルで template
機能を宣言する必要があります。
<automotiveApp>
<uses name="template" />
</automotiveApp>
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-08-27 UTC。
[null,null,["最終更新日 2025-08-27 UTC。"],[],[],null,["Review the following information to learn how make changes to your app's manifest\nso that Android Auto can discover and interact with your app's `CarAppService`.\n\nDeclare Android Auto support\n\nThe [Android Auto host](/training/cars/apps#key-terms-concepts) checks whether\nthe app has declared support for [Android Auto](/training/cars#auto).\nTo enable this support, include the following entry in your app's 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\nThis manifest entry refers to another XML file that you create with the\npath \u003cvar translate=\"no\"\u003eAppProjectDirectory\u003c/var\u003e`/app/src/main/res/xml/automotive_app_desc.xml`.\nIn that file, you declare what Android Auto capabilities your app supports.\n\nApps using the [Android for Cars App\nLibrary](/reference/androidx/car/app/package-summary)\nmust declare the `template` capability in the `automotive_app_desc.xml` file: \n\n \u003cautomotiveApp\u003e\n \u003cuses name=\"template\" /\u003e\n \u003c/automotiveApp\u003e"]]