自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
将车载设备界面库集成到应用中
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
车载设备界面库包含供应用实现的两个元素:
应用通过将车载设备界面库添加为依赖项进行集成:
设置车载设备界面组件样式
通常,应用应能够通过提供数据(在特定情况下提供图像和图标),实现所有必要的功能。例如,车载设备界面库应提供“返回”、“关闭”、“搜索”和“菜单”等标准图标。如果您发现缺少资源或存在无法使用现有组件实现的功能,请联系 Android Automotive 合作伙伴工程部。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-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"]],["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Integrate the Car UI library into apps\n\nCar UI library contains two elements for apps to implement:\n\n- **Components.**Java classes that implement a specific behavior. For example,\n CarUiRecyclerView and Toolbar.\n\n- **Resources.** Individual Android resources that represent the *knobs*\n available for OEMs to achieve consistency with their own design. The components above use these\n resources to become *customizable*.\n\nApps integrate Car UI library by adding it as a dependency:\n\n- Android 9 and Android 10 (`Android.mk` file), add the following:\n\n ```maple\n LOCAL_STATIC_ANDROID_LIBRARIES := car-ui-lib\n ```\n- Android 11 (and higher) (`Android.bp`), add the following:\n\n ```scdoc\n static_libs: [\n ...\n \"car-ui-lib-bp\",\n ]\n ```\n\nStyle Car UI components\n-----------------------\n\nIn general, apps should be able to achieve all necessary functionality by providing\ndata and, in certain cases, images and icons. For example, standard icons such as Back, Close,\nSearch, and Menu are provided by the Car UI library. Engage with Android Automotive Partner\nEngineering if you find there are missing resources or if there is functionality that can't be\nachieved with the provided components."]]