Android之Bluetooth详解

  • Post author:
  • Post category:其他


对于Android的英文帮助文档,总是看了记不住,远不如对中文资料那么印象深,所以下面的叙述都是对Android帮助文档Bluetooth的翻译。


一、Bluetooth


Android平台包含了对Bluetooth协议栈的支持,允许机器通过Bluetooth设备进行无线数据交换。应用框架通过Android Bluetooth API访问Bluetooth功能模块。 这些API能让应用无线连接其他Bluetooth设备,实现点对点和多点之间的通信。

运用蓝牙API,Android应用程序可以完成如下操作:


1、扫描其他Bluetooth设备。

2、查询配对Bluetooth设备的本地Bluetooth适配器。

3、建立RFCOMM通道。

4、通过服务探索连接到其他设备。

5、与其他设备进行数据传输。

6、管理多个连接


二、The Basics


本文描述如何使用Android Bluetooth APIs完成Bluetooth通讯的4个必要任务:设置Bluetooth,搜寻本地配对或者可用的Bluetooth设备,连接Bluetooth设备,与Bluetooth设备进行数据传输。

所有可用的Bluetooth APIs都包含在android.bluetooth包中。下面是建立Bluetooth连接需要用到的类和接口的总结:



版权声明:本文为u012035086原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。