ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
ภาพรวม
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ยานพาหนะรุ่นถัดไปรองรับหน้าจอหลายจอ ซึ่งบางหน้าจออาจทำงานด้วย Android เพื่อแสดงเนื้อหาที่สมบูรณ์ หน้านี้อธิบายองค์ประกอบหลักในการผสานรวมแผงหน้าปัดและจอแสดงผลอื่นๆ เข้ากับระบบ IVI ของ Android Automotive
จอแสดงผลภายนอกใน Android
Android 10 ใช้ android.app.Presentation API เพื่อรองรับการใช้จอแสดงผลภายนอก
การนำเสนอคือกล่องโต้ตอบที่ไม่ซ้ำกัน ซึ่งมีไว้เพื่อนำเสนอเนื้อหาบนจอแสดงผลรอง ระบบจะเชื่อมโยงการนำเสนอกับจอแสดงผลเป้าหมาย ณ เวลาที่สร้างขึ้น และกำหนดค่าบริบทและทรัพยากรตามเมตริกของจอแสดงผล
จอแสดงผลแผงหน้าปัด
Presentation API เพียงพอสำหรับการแสดงผลแผงหน้าปัดทั่วไป ซึ่งมีข้อจำกัดต่อไปนี้
รูปที่ 1 ตัวอย่างการแสดงผลของแผงหน้าปัด
Presentation API ไม่จำเป็นต้องมี
- โฟกัสเสียงแยกต่างหาก
- เพื่อเรียกใช้กิจกรรมหรือแอปทั้งหมด
- เพื่อพิจารณาอินพุตของผู้ใช้พร้อมกัน
- วิธีจัดการเหตุการณ์การแตะ
ดูข้อมูลเพิ่มเติมเกี่ยวกับการใช้จอแสดงผลหลายจอได้ที่ภาพรวมจอแสดงผลหลายจอ
ข้อกําหนดเบื้องต้น: คุณควรมีความคุ้นเคยกับการพัฒนาWindowManager ของ Android เวอร์ชันก่อนหน้าบ้าง
ประเภทเนื้อหาที่รองรับ
รถยนต์บางรุ่นอาจไม่ต้องการให้ Android วาดกราฟิกแผงหน้าปัดเรือนไมล์โดยตรง แต่ยังคงต้องการแสดงข้อมูล เช่น คำแนะนำแบบเลี้ยวต่อเลี้ยวหรือชื่อเพลง Android สามารถส่งข้อมูลดังกล่าวได้หลายวิธี อุปกรณ์ Android สามารถส่งเนื้อหาหน้าปัดเป็นรูปแบบต่อไปนี้
- อิงตามข้อมูลเมตา เช่น ส่งข้อความผ่าน CAN ผ่าน
CarVendorExtensionManager
หรือ VehicleNetworkService
ระบบคลัสเตอร์ของเครื่องมือวัดต้องสร้างกราฟิกที่เหมาะสมตามข้อมูลเมตา
- กราฟิกเป็นพื้นฐาน ไปจนถึงจอแสดงผลจริงหรือเสมือนจริง จอแสดงผลอาจเป็นจอแสดงผลเฉพาะภายในหน้าปัด หรือเป็นส่วนหนึ่งของจอแสดงผลหน้าปัดแบบกราฟิกทั้งหมด
ตัวอย่างสถาปัตยกรรมฮาร์ดแวร์สำหรับจอแสดงผลหน้าปัดแบบกราฟิก
รูปที่ 2 ตัวอย่างจอแสดงผลหน้าปัดแบบกราฟิกของ Android Automotive
ระบบปฏิบัติการที่สำคัญต่อความปลอดภัย (มีหน้าที่แสดงผลคลัสเตอร์เครื่องมือ) และ Android อาจอยู่ใน SoC แบบหลายแกนเดียวกัน (เช่น ใช้ Cortex-R สำหรับระบบปฏิบัติการแบบเรียลไทม์โดยเฉพาะ และ Cortex-A สำหรับ Android) อินเทอร์เฟซอาจเป็น Ethernet AVB (Audio Video Bridge), LVDS หรือ HDMI ใน Android แผงหน้าปัดแบบกราฟิกจะเชื่อมต่อเป็นจอแสดงผลเสมือนได้ ซึ่งจะซ่อนสถาปัตยกรรมฮาร์ดแวร์ไว้เบื้องหลังการใช้งาน Display HAL
ข้อจำกัดของเบาะหลัง
สำหรับความบันเทิงบนที่นั่งด้านหลัง Presentation API มีข้อจำกัดต่อไปนี้
- โปรเจ็กต์กิจกรรมทั้งหมดไม่ได้ (การนำเสนอเป็นกล่องโต้ตอบ)
- โฟกัสเสียงใช้ได้เพียงรายการเดียว
- ไม่มีผู้ใช้ที่ใช้งานพร้อมกัน
- ไม่มีเหตุการณ์การสัมผัสโดยตรงสําหรับจอแสดงผลภายนอก (ต้องใช้ขั้นตอนการแทรกแยกต่างหาก)
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","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-07-27 UTC"],[],[],null,["# Overview\n\nNext-generation vehicles support multiple screens, some of which\nmight be operated by Android to provide rich contents. This page describes the\nkey elements to integrate instrument cluster and other displays into an Android\nAutomotive IVI system.\n\nExternal displays in Android\n----------------------------\n\nAndroid 10 uses the [android.app.Presentation](https://developer.android.com/reference/android/app/Presentation.html) API to support the use of external displays.\nA *presentation* is a unique dialog, its purpose to present content on a secondary\ndisplay. A presentation is associated with the target\n[Display](https://developer.android.com/reference/android/view/Display.html)\nat the time of creation and configures its context and resource configuration according\nto the display metrics.\n\nInstrument cluster display\n--------------------------\n\nThe Presentation API is sufficient for a typical instrument cluster display, which has these\nallowances: \n**Figure 1**. Sample instrument cluster display\n\nThe Presentation API does not need:\n\n- Separate audio focus.\n- To run the entire activity or app.\n- To consider concurrent user input.\n- To handle touch events.\n\nTo learn more about the use of multiple displays, see\n[Multi-display overview](/docs/core/display/multi_display).\n\n**Prerequisite** : Some familiarity with previous\ndevelopments of the Android [WindowManager](https://developer.android.com/reference/android/view/WindowManager) is helpful.\n\n\nSupported content types\n-----------------------\n\nSome vehicles may not want Android to draw instrument cluster graphics\ndirectly, but still want to show information such as turn-by-turn guidance or\nmusic title. Android can send such data in several ways. An Android device can\nsend instrument cluster content as:\n\n- Metadata-based, such as sending messages through CAN through `CarVendorExtensionManager` or `VehicleNetworkService`. The instrumental cluster system must create appropriate graphics based on the metadata.\n- Graphics-based, to physical or virtual display. The display may be a dedicated display inside the gauge cluster, or part of a fully graphical instrument cluster display.\n\nExample hardware architecture for a graphics-based instrument cluster\ndisplay:\n\n\n**Figure 2.** Sample Android Automotive graphics-based instrument cluster display.\n\nThe safety-critical (responsible for rendering instrument cluster) and\nAndroid OS may reside on the same multi-core SoC (for example, dedicate Cortex-R\nfor real-time OS and Cortex-A for Android). The interface can be Ethernet AVB\n(Audio Video Bridge), LVDS, or HDMI. In Android, the Graphics Instrument Cluster\ncould be connected as a Virtual Display, hiding the hardware architecture behind\n[Display HAL](https://developer.android.com/reference/android/hardware/display/VirtualDisplay.html)\nimplementation.\n\nRear seat limitations\n---------------------\n\nFor rear seat entertainment, the presentation API has the following\nlimitations:\n\n- Can't project the entire activity (presentation is a dialog).\n- Only one audio focus available.\n- No concurrent users.\n- No direct touch events for the external display (needs separate injection flow)."]]