اختبار أغراض تطبيق التنقّل على نظام التشغيل Android Automotive
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
اختبار إمكانية التشغيل التفاعلي بين "مساعد Google" و"خرائط Google" والتطبيقات المخصّصة على نظام التشغيل Android Automotive
نظرة عامة
يوضّح هذا الدليل كيفية إعداد وتشغيل مثيل Android Automotive مع تجربة Google المتكاملة. يوضّح هذا الدليل أيضًا كيفية اختبار واجهات برمجة التطبيقات التابعة لجهات خارجية من Google لاستخدامها مع حلول الملاحة والحلول المستندة إلى الصوت.
كما هو موضّح، يمكنك استخدام ثلاثة أنواع من الأهداف لوصف التفاعل بين المساعد والتنقل: التنقل والبحث والإجراءات المخصّصة.
يوضّح هذا المحتوى كيفية اختبار الأهداف باستخدام "خرائط Google". نوضّح أيضًا كيفية دمج تطبيق تنقّل مخصّص لتلقّي طلبات من "مساعد Google".
لتحديد التطبيق التجريبي كمستلِم للأهداف التي يتم تشغيلها
من خلال "مساعد Google"، اتّبِع الخطوات التالية:
انتقِل إلى الإعدادات > Google > "مساعد Google" > تطبيق التنقّل التلقائي.
الشكل 1. اختَر تطبيق التنقّل التلقائي.
انقر على رمز الميكروفون وتحدّث بطلب البحث. على سبيل المثال، "المطاعم القريبة". اطّلِع على عناصر التحكّم والإعدادات والمساعدة الموسّعة إذا لم يعمل الميكروفون على النحو المتوقّع.
يرسل "مساعد Google" معرّف الموارد المنتظم الخاص بالغرض إلى تطبيق التنقّل لمعالجته بشكل أكبر.
الشكل 2. ناتج Intent الذي أنشأه "مساعد Google"
التفاصيل الفنية
يمكنك استخدام Android Debug Bridge (adb) لتفعيل الأهداف من وحدة التحكّم.
لمزيد من المعلومات، يُرجى الاطّلاع على gas-intents-console-tests.txt.
لتحديد أنّ أحد التطبيقات يمكنه تلقّي طلبات من "مساعد Google"، أدرِج الرمز التالي في ملف AndroidManifest.xml الخاص بتطبيق التنقّل:
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["Test interoperability of Google Assistant and Google Maps with custom Apps on\nAndroid Automotive OS.\n\nOverview\n\nThis guide describes how to set up and run an Android Automotive instance with\nGoogle built-in. This guide also describes how to test the third-party\nGoogle APIs for use with navigation and voice solutions.\n\nTo learn more about these APIs, see [Implement navigation app intents](/develop/devices/assistant/intents-assistant-nav-app)\nand [Google Maps for Android Automotive Intents](/training/cars/platforms/automotive-os/android-intents-automotive).\n\nAs shown, you can use three types of intents to describe the interaction between\nassistant and navigation: navigation, search and custom actions.\nThis content describes how to test the intents with Google Maps. We also\ndescribe how integrate a custom navigation application to receive intents\nfrom Google Assistant.\n\nSetup\n\nTo get started:\n\n1. Download and install [Android Studio](/studio).\n2. Open **Tools \\\u003e Device Manager** and add the **Automotive (1408p landscape) with Google Play** image.\n3. Start the emulator image and sign in to Google Play. Search for and update Google Assistant.\n4. Extract the contents of our [demo application project](/static/training/cars/testing/gas-intents/GasIntentTests.tgz) and open the project in Android Studio (**File \\\u003e Open...**).\n5. Select **Run \\\u003e Run automotive** to install and start the demo application in the emulator.\n\nDemo\n\n[Implement navigation app intents](/develop/devices/assistant/intents-assistant-nav-app) and\n[Google Maps for Android Automotive Intents](/training/cars/platforms/automotive-os/android-intents-automotive) describe the three types of\nintents you can execute: Navigation, Search, and Custom Action.\nMain activity of demo application\n\nGoogle Maps executes the triggered operations.\n\nTo specify the demo application as the receiver of the intents triggered\nby Google Assistant:\n\n1. Go to **Settings \\\u003e Google \\\u003e Google Assistant \\\u003e Default navigation app.**\n\n Figure 1. Select the default navigation App.\n2. Click the **Microphone** icon and speak a query. For example \"Nearby\n restaurants.\". See [Extended controls, settings, and help](/studio/run/emulator-extended-controls#microphone) if the microphone\n does not work as expected.\n The intent URI is sent by Google Assistant to the navigation app to process\n further.\n\n Figure 2. Output of Google Assistant generated Intent.\n\nTechnical Details\n\nYou can use the Android Debug Bridge (adb) to trigger intents from the console.\nTo learn more, see [gas-intents-console-tests.txt](/static/training/cars/testing/gas-intents/gas-intents-console-tests.txt).\n\nTo designate that an application can receive intents from\nGoogle Assistant, include this code in the `AndroidManifest.xml` file of the\nnavigation application: \n\n \u003c!-- Navigation Intent --\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"androidx.car.app.action.NAVIGATE\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\"/\u003e\n \u003cdata android:scheme=\"geo\" /\u003e\n \u003c/intent-filter\u003e\n\n \u003c!-- Search Intent --\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\"/\u003e\n \u003cdata android:scheme=\"geo\" /\u003e\n \u003c/intent-filter\u003e\n\n \u003c!-- Custom Action Intents --\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\"/\u003e\n \u003cdata android:scheme=\"geo.action\" /\u003e\n \u003c/intent-filter\u003e\n\nTo add the app to\n**Settings \\\u003e Google \\\u003e Google Assistant \\\u003e Default navigation app**\nso that it can be seen and selected, add: \n\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.MAIN\" /\u003e\n \u003ccategory android:name=\"android.intent.category.APP_MAPS\" /\u003e\n \u003c/intent-filter\u003e"]]