自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
Android 中的交互功能
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页介绍了 Android 如何处理从键盘、传感器等接收的各种输入。
触感反馈
Android 触感反馈子系统是指有助于通过触觉产生刺激的硬件和软件功能。本部分提供了有关如何充分利用 Android 触感反馈 API 的指导和合规性说明。
Android 输入子系统名义上由遍历系统多个层的事件管道组成。在最低层,物理输入设备会生成描述状态更改(例如按键按压和轻触接触点)的信号。
Neural Networks API
Android Neural Networks API (NNAPI) 可针对机器学习运行计算密集型运算。本文档简要介绍了如何为 Android 9 实现 Neural Networks API 驱动程序。
外围设备和配件
借助一套标准协议,您可以实现可在各种 Android 设备中扩展 Android 功能的强大外围设备和其他配件。
传感器
Android 传感器使应用可以访问移动设备的底层物理传感器。它们是负责提供数据的虚拟设备,由传感器硬件抽象层 (HAL) sensors.h
进行定义。
Context Hub 运行时环境
Context Hub 运行时环境 (CHRE) 通过简单、标准化的嵌入式 API,为在低功耗处理器上运行系统级应用提供了一个通用平台。CHRE 使原始设备制造商 (OEM) 能够从应用处理器中分流处理进程,从而节省电量并改进用户体验的各个方面,同时它还支持一类始终开启并能感知情境的功能。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-04。
[[["易于理解","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-04-04。"],[],[],null,["# Interaction in Android\n\nThis page explains how Android processes the various inputs it receives from\nthe keyboard, sensors, and more.\n\nHaptics\n-------\n\nThe Android haptics subsystem refers to hardware and software features that\ncontribute to the creation of stimuli through the sense of touch. This section\nprovides guidance and compliance instructions on the best use of Android haptics\nAPIs.\n\nInput\n-----\n\nThe Android input subsystem nominally consists of an event pipeline that\ntraverses multiple layers of the system. At the lowest layer, the physical input\ndevice produces signals that describe state changes such as key presses and\ntouch contact points.\n\nNeural Networks API\n-------------------\n\nThe Android Neural Networks API (NNAPI) runs computationally intensive\noperations for machine learning. This document provides an overview on how to\nimplement a Neural Networks API driver for Android 9.\n\nPeripherals and accessories\n---------------------------\n\nUsing a suite of standard protocols, you can implement compelling peripherals\nand other accessories that extend Android capabilities in a wide range of\nAndroid-powered devices.\n\nSensors\n-------\n\nAndroid sensors give apps access to a mobile device's underlying\nphysical sensors. They are data-providing virtual devices defined by\n`sensors.h`, the sensor Hardware Abstraction Layer (HAL).\n\nContext Hub Runtime Environment\n-------------------------------\n\nContext Hub Runtime Environment (CHRE) provides a common platform for running\nsystem-level apps on a low-power processor, with a simple, standardized,\nembedded-friendly API. CHRE makes it easy for device OEMs to offload processing\nfrom the applications processor, to save battery and improve various areas of\nthe user experience, and enable a class of always-on, contextually aware\nfeatures."]]