Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release, bukan aosp-main, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Android Open Source Project (AOSP) Automotive App Host adalah bagian dari Library Aplikasi Mobil
yang digunakan oleh developer pihak ketiga (3P) untuk mengaktifkan aplikasi untuk Android Automotive. App Host adalah aplikasi
sistem yang memungkinkan aplikasi mobil pihak ketiga merender komponen antarmuka pengguna (UI) bergaya OEM atas namanya.
Untuk menjalankan aplikasi pihak ketiga, aplikasi pihak ketiga dan Host Aplikasi Otomotif AOSP harus
diinstal:
Automotive App Host menyediakan serangkaian template dan komponen UI
yang dioptimalkan untuk kendaraan, termasuk kemampuan seperti kegunaan dan keamanan, kepada aplikasi pihak ketiga.
OEM dapat menata gaya template dan komponen UI ini.
Hasilnya? Aplikasi pihak ketiga terintegrasi dengan baik secara visual ke dalam
sistem infotainment OEM.
Halaman ini menjelaskan cara membuat Host Aplikasi Otomotif AOSP dari project Gradle di
cabang ub-automotive, lalu cara mengintegrasikan Host Aplikasi Otomotif AOSP ke dalam target
mobil.
Periksa ub-automotive, lalu buka project Gradle di bagian
packages/apps/Car/Templates/Host.
Untuk mengonfigurasi project dengan Android SDK, konfigurasikan file
local.properties project Anda. Anda dapat menemukan jalurnya di bagian Setelan Android SDK di Android
Studio.
sdk.dir=${path_to_android_sdk_location}
Buat APK host sebagai project Gradle standar. Misalnya, jalankan perintah gradle:
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# AOSP host integration guide\n\nThe Android Open Source Project (AOSP) Automotive App Host is a part of the Car App Library\nused by third-party (3P) developers to enable apps for Android Automotive. The App Host is a system\napp that allows 3P car apps to render OEM-styled user interface (UI) components on its behalf.\n\nTo run 3P apps, both the 3P app and the AOSP Automotive App Host must be\ninstalled:\n\n- Automotive App Host provides 3P apps with a a set of UI templates and components optimized for vehicles, including capabilities like usability and safety.\n- OEMs can style these UI templates and components.\n- **The result?** 3P apps are visually well-integrated into the infotainment system of the OEM.\n\nThis page explains how to generate the AOSP Automotive App Host from the Gradle project in the\n`ub-automotive` branch and then how to integrate the AOSP Automotive App Host into car\ntargets.\n\nCheck out the code\n------------------\n\nTo check out the unbundled code:\n\n1. Run the following command: \n\n ```text\n repo init -u https://android.googlesource.com/platform/manifest -b ub-automotive-master\n repo sync -j4\n ```\n2. To learn more about working with AOSP source code, see\n [Initialize a Repo client](/docs/setup/download/downloading#initializing-a-repo-client).\n\n3. Install [Android Studio](https://developer.android.com/studio).\n\nCreate the AOSP host APK\n------------------------\n\n1. Check out `ub-automotive` and then open the Gradle project under `packages/apps/Car/Templates/Host`.\n2. To configure the project with the Android SDK, configure your project's `local.properties` file. You can find the path under Android SDK Settings in Android Studio. \n\n ```genshi\n sdk.dir=${path_to_android_sdk_location}\n ```\n3. Create the host APK as a typical Gradle project. For example, run the `gradle` command: \n\n ```text\n ./gradlew :app:assembleDebug\n ```\n\n The APK file is located in:\n\n ```carbon\n packages/apps/Car/Templates/Host/app/build/outputs/apk/debug/app-debug.apk\n ```\n\nEmbed the AOSP host\n-------------------\n\n1. Create a new `Android.mk` file to include the following content: \n\n ```carbon\n LOCAL_PATH := $(my-dir)\n ################## Start of AOSPHost target ##################\n include $(CLEAR_VARS)\n LOCAL_MODULE := CarAOSPHost\n LOCAL_LICENSE_KINDS := legacy_notice\n LOCAL_LICENSE_CONDITIONS := notice\n LOCAL_MODULE_OWNER := google\n LOCAL_SRC_FILES := AOSPHost.apk\n LOCAL_MODULE_CLASS := APPS\n LOCAL_MODULE_TAGS := optional\n LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)\n LOCAL_BUILT_MODULE_STEM := package.apk\n LOCAL_CERTIFICATE := PRESIGNED\n LOCAL_PRIVILEGED_MODULE := true\n LOCAL_PRODUCT_MODULE := true\n LOCAL_DEX_PREOPT := false\n include $(BUILD_PREBUILT)\n ```\n2. Rename the `app-debug.apk` to `AOSPHost.apk` and put the APK in the same folder as `Android.mk`.\n3. Add the `CarAOSPHost` module to your targets as `PRODUCT_PACKAGES`: \n\n ```scdoc\n PRODUCT_PACKAGES += \\\n CarAOSPHost \\\n ```\n\nAdd the permissions config\n--------------------------\n\n1. Create a file called `com.android.car.templates.host.xml` to contain the following: \n\n ```carbon\n \u003cpermissions\u003e\n \u003c!-- Rename the package to com.android.car.templates.host --\u003e\n \u003cprivapp-permissions package=\"com.android.car.templates.host\"\u003e\n \u003c!-- To be able to display activities in the cluster --\u003e\n \u003cpermission name=\"android.car.permission.CAR_DISPLAY_IN_CLUSTER\" /\u003e\n\n \u003c!-- To be able to show navigation state (turn by turn directions) in the cluster.--\u003e\n \u003cpermission name=\"android.car.permission.CAR_NAVIGATION_MANAGER\" /\u003e\n\n \u003c!-- To be considered a system-approved host --\u003e\n \u003cpermission name=\"android.car.permission.TEMPLATE_RENDERER\" /\u003e\n \u003c/privapp-permissions\u003e\n\n \u003c!-- Declare support for templated applications. --\u003e\n \u003cfeature name=\"android.software.car.templates_host\" /\u003e\n \u003c/permissions\u003e\n ```\n2. In your target, add the config file to your targets: \n\n ```makefile\n PRODUCT_COPY_FILES += \\\n \u003cthe file root\u003e/com.android.car.templates.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/com.android.car.templates.host.xml\n ```\n\nBuild the target\n----------------\n\nWhen you build the target, the host is installed and permission is granted:\n\n```component-pascal\n ...\n android.car.permission.CAR_NAVIGATION_MANAGER: granted=true\n android.car.permission.CAR_DISPLAY_IN_CLUSTER: granted=true\n android.car.permission.TEMPLATE_RENDERER: granted=true\n ...\n```\n| **Note:** The permission `android.car.permission.TEMPLATE_RENDERER` is *only* available after Android API level 32.\n\nTest the integration\n--------------------\n\nTo build and install the samples, see this GitHub project,\n[car-samples/car_app_library](https://github.com/android/car-samples/tree/main/car_app_library)."]]