پشتیبانی از 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 استفاده میکنند باید قابلیت template
را در فایل automotive_app_desc.xml
اعلام کنند:
<automotiveApp>
<uses name="template" />
</automotiveApp>
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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"]],["تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی."],[],[],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"]]