blob: fb7202cc1146b4106c40c2e6780840f3385321fc [file] [log] [blame]
<html devsite><head>
<title>Android 开放配件 (AOA)</title>
<meta name="project_path" value="/_project.yaml"/>
<meta name="book_path" value="/_book.yaml"/>
</head>
<body>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p>Android 开放配件 (AOA) 支持功能可让外部 USB 硬件(Android USB 配件)与处于配件模式下的 Android 设备进行交互。<em></em>当某台 Android 设备处于配件模式时,所连接的配件会充当 USB 主机(为总线供电并列举设备),而 Android 设备则充当 USB 配件。
</p>
<p>Android USB 配件专门用于和 Android 设备相连。这些配件遵循 AOA 要求,从而能够检测到支持配件模式的 Android 设备,并且必须提供 500 毫安(电压为 5 伏)的充电电流。之前发布的部分 Android 设备只能充当 USB 设备,无法发起与外部 USB 设备的连接。AOA 支持功能打破了这一局限,让您能够构建可以与各种 Android 设备建立连接并与其进行交互的配件。
</p>
<p class="note"><strong>注意</strong>:配件模式取决于设备硬件;部分设备可能不支持配件模式。您可以在相应应用的 Android 清单中使用 <code>&lt;uses-feature&gt;</code> 元素来滤出支持配件模式的设备。有关详情,请参阅 <a href="http://developer.android.com/guide/topics/connectivity/usb/accessory.html#manifest">USB 配件</a>开发者指南。</p>
<p>AOA 有以下两个版本,分别支持不同通信类型:</p>
<ul>
<li><strong>AOAv1</strong>。支持通用配件通信和 adb 调试。适用于 Android 3.1(API 级别 12)及更高版本,也可以在 Android 2.3.4(API 级别 10)及更高版本中通过<a href="https://developers.google.com/android/add-ons/google-apis/">附加库</a>来实现。</li>
<li><strong>AOAv2</strong>。支持音频流式传输和人机接口设备 (HID) 功能。适用于 Android 4.1(API 级别 16)。</li>
</ul>
</body></html>