إضافة ميزة التوافق مع Android Auto إلى تطبيقك المتوقف
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
على الأجهزة التي تعمل بنظام التشغيل Android 15 أو إصدار أحدث، يتيح Android Auto تشغيل التطبيقات في فئات التطبيقات المتوافقة التي تعمل في وضع الإيقاف مباشرةً على الوحدة الرئيسية. اطّلِع على التطبيقات المتوقفة للحصول على مزيد من المعلومات عن تجربة المستخدم للتطبيقات المتوقفة على Android Auto.
الإفصاح عن توافق التطبيق مع Android Auto
للإشارة إلى أنّ تطبيقك متوافق مع Android Auto، يجب تضمين العنصر التالي
<category> في فلتر الأهداف لنشاط في ملف بيان تطبيقك:
بشكل عام، يمكن وضع عنصر الفئة android.intent.category.CAR_LAUNCHER
في فلتر الأهداف نفسه المستخدَم لعنصر android.intent.category.LAUNCHER
، ولكن يمكن وضعه في فلتر مختلف إذا كان ذلك مفضّلاً.
أن تكون متوافقة مع أحجام شاشات Android Auto الشائعة
لتقديم أفضل تجربة للمستخدم، ننصحك بجعل تطبيقك متوافقًا تمامًا
مع أحجام الشاشات المختلفة. على الأقل، لضمان تجربة عالية الجودة
في مجموعة متنوعة من السيارات المتوافقة مع Android Auto، يجب عدم
عرض التطبيقات بشكل مربّع أفقي بشكل كبير على الشاشات الأفقية، كما هو موضّح في DO-2
إرشادات جودة تطبيقات السيارات.
على سبيل المثال، إذا كان التطبيق يعمل بنسبة عرض إلى ارتفاع عمودية مع وضع المحتوى في إطار عمودي على شاشة بدورة أفقية، سيتم رفضه أثناء عملية المراجعة في "متجر Play". إنّ التطبيق الذي يعمل
بنسبة عرض إلى ارتفاع أفقية مع الحد الأدنى من اقتصاص الشاشة على شاشة أفقية هو
مقبول، وكذلك التطبيق الذي يعمل بنسبة عرض إلى ارتفاع أفقية مع اقتصاص الشاشة عموديًا
على شاشة عمودية.
اختبار التوافق مع أحجام الشاشة الأساسية
عند إنشاء تطبيقك واختباره لنظام Android Auto، يمكنك استخدام إعدادات وحدة التحكّم في السيارة (DHU) التالية للتأكّد من استيفاء تطبيقك لل requirements:
المتطلبات السابقة:
معرّف العرض للشاشة النشطة عندما يكون تطبيقك قيد التشغيل على شاشة
غير شاشة مدمجة، مثل عند استخدامه من خلال Android Auto، تكون هذه القيمة
مختلفة عن DEFAULT_DISPLAY.
يوضّح المقتطف التالي كيفية دمج هذه الإشارات لرصد الاستخدام من خلال
Android Auto:
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-08 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-08-08 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Add support for Android Auto to your parked app\n\nOn devices running Android 15 or higher, Android Auto supports running\napps in [supported parked app categories](/training/cars#parked) directly on the head unit. See\n[Parked apps](/training/cars/platforms/android-auto#parked-apps) for more information about the parked app user experience on\nAndroid Auto.\n\nDeclare Android Auto support\n----------------------------\n\nTo declare that your app supports Android Auto, you must include the following\n`\u003ccategory\u003e` element in the intent filter of an activity in your app's manifest: \n\n \u003cactivity ...\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n ...\n \u003ccategory android:name=\"android.intent.category.CAR_LAUNCHER\" /\u003e\n \u003c/intent-filter\u003e\n \u003c/activity\u003e\n\nGenerally, the `android.intent.category.CAR_LAUNCHER` category element can\nbe placed in the same intent filter as the `android.intent.category.LAUNCHER`\nelement, but it can be in a different one if preferred.\n| **Caution:** Be careful not to promote builds that support Android Auto to track types other than those listed in [Supported app categories](/training/cars#parked), or your submission will be rejected [during review](/training/cars/distribute#understand-review).\n\n### Category-specific manifest entries\n\nIn addition to the preceding requirement, games have an additional requirement.\nSee [Mark your app as a game](/training/cars/parked/games#mark-game).\n| **Important:** Games are the only parked app category supported by Android Auto at this time.\n\nSupport common Android Auto screen sizes\n----------------------------------------\n\nFor the best user experience, we recommend making your app [fully adaptive](/develop/ui/compose/build-adaptive-apps)\nto different screen sizes. At the minimum, to ensure a high quality experience\nin the variety of cars that support Android Auto, apps **must not** be\nsignificantly pillarboxed on landscape screens, as captured by the [`DO-2`](/docs/quality-guidelines/car-app-quality#DO-2)\ncar app quality guideline.\n\nFor example, if an app runs in a portrait aspect ratio with pillarboxing on a\nlandscape screen, it will be rejected during Play Store review. An app running\nin a landscape aspect ratio with minimal pillarboxing on a landscape screen is\nacceptable, as is an app running in a landscape aspect ratio with letterboxing\non a portrait screen.\n| **Tip:** See [Support large screen resizability](/games/develop/multiplatform/support-large-screen-resizability) for game-specific guidance on adapting to different screen sizes.\n\n### Test against canonical screen sizes\n\nWhen building and testing your app for Android Auto, you can use the following\n[Desktop Head Unit (DHU) configurations](/training/cars/testing/dhu#configure-dhu) to verify that your app meets the\npreceding requirements: \n\n### Small Landscape\n\n [general]\n resolution = 800x480\n dpi = 160\n ...\n\n| **Tip:** This is the default configuration used when running the DHU, and represents the most common configuration for cars that support Android Auto.\n\n### Wide Landscape\n\n [general]\n resolution = 1920x1080\n dpi = 160\n marginheight = 596\n normalizedpi = true\n cropmargins = true\n ...\n\n### Portrait\n\n [general]\n resolution = 1920x1080\n dpi = 160\n marginwidth = 878\n normalizedpi = true\n cropmargins = true\n ...\n\nDetect usage on Android Auto\n----------------------------\n\nIf you'd like to detect when your app is being used through Android Auto (such\nas for analytics purposes), you can look at two signals:\n\n- The connection state reported by the [`CarConnection`](/training/cars/apps#car-connection) API. When Android Auto is connected, this will be [`CONNECTION_TYPE_PROJECTION`](/reference/androidx/car/app/connection/CarConnection#CONNECTION_TYPE_PROJECTION).\n- The display ID of the active display. When your app is running on a display other than a built-in screen, such as when used through Android Auto, this is a value other than [`DEFAULT_DISPLAY`](/reference/android/view/Display#DEFAULT_DISPLAY).\n\nThe following snippet shows how to combine these signals to detect usage through\nAndroid Auto: \n\n val connectionType = ...\n val displayId = context.display.displayId\n isRunningOnAndroidAuto = connectionType == CONNECTION_TYPE_PROJECTION and displayId != DEFAULT_DISPLAY\n\n| **Caution:** This method might not always be accurate. A device could be connected to both Android Auto and another display, and your app might be running on that other display."]]