اهداف برنامه ناوبری را در سیستم عامل Android Automotive تست کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
قابلیت همکاری Google Assistant و Google Maps را با برنامه های سفارشی در سیستم عامل Android Automotive تست کنید.
نمای کلی
این راهنما نحوه راهاندازی و اجرای نمونه Android Automotive را با Google داخلی توضیح میدهد. این راهنما همچنین نحوه آزمایش Google APIهای شخص ثالث را برای استفاده با راهحلهای ناوبری و صوتی شرح میدهد.
همانطور که نشان داده شده است، می توانید از سه نوع هدف برای توصیف تعامل بین دستیار و ناوبری استفاده کنید: ناوبری، جستجو و اقدامات سفارشی. این محتوا نحوه آزمایش مقاصد با Google Maps را شرح می دهد. ما همچنین نحوه ادغام یک برنامه ناوبری سفارشی برای دریافت مقاصد از دستیار Google را توضیح می دهیم.
برای تعیین برنامه آزمایشی به عنوان گیرنده مقاصد فعال شده توسط Google Assistant:
به Settings > Google > Google Assistant > Default navigation app بروید.
شکل 1. برنامه ناوبری پیش فرض را انتخاب کنید.
روی نماد میکروفون کلیک کنید و یک پرس و جو بیان کنید. به عنوان مثال "رستوران های نزدیک". اگر میکروفون آنطور که انتظار می رود کار نمی کند، به کنترل ها، تنظیمات و راهنماهای توسعه یافته مراجعه کنید. Intent URI توسط Google Assistant به برنامه ناوبری ارسال می شود تا بیشتر پردازش شود.
شکل 2. خروجی Google Assistant Intent ایجاد شده.
جزئیات فنی
میتوانید از پل اشکالزدایی اندروید (adb) برای راهاندازی intentها از کنسول استفاده کنید. برای کسب اطلاعات بیشتر، gas-intents-console-tests.txt را ببینید.
برای تعیین اینکه برنامهای میتواند هدفها را از دستیار Google دریافت کند، این کد را در فایل AndroidManifest.xml برنامه ناوبری قرار دهید:
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و 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"]]