Bluetooth---初步了解Android 蓝牙4.0

提供管理蓝牙功能的类,比如对设备的扫描,连接设备,和管理设备之间的传输数据。蓝牙API支持经典蓝牙和低功耗蓝牙。

Provides classes that manage Bluetooth functionality, such as scanning for devices, connecting with devices, and managing data transfer between devices. The Bluetooth API supports both "Classic Bluetooth" and Bluetooth Low Energy.

有关很多其它的经典蓝牙信息。能够看Bluetooth指南。有关很多其它的低功耗蓝牙的信息,能够看BLE指南。


For more information about Classic Bluetooth, see the Bluetooth guide. For more information about Bluetooth Low Energy, see the Bluetooth Low Energy (BLE) guide.

Bluetooth APIs 能够使得应用具备下面功能:

1.对于其它的蓝牙设备的扫描(包含BLE设备)

2.为配对的蓝牙设备查询本地蓝牙适配器

3.建立RFCOMM channels/sockets.

4.连接在其他设备上指定的sockets

5.与其他设备之间数据传输

6.与BLE设备交流。比如接近传感器,心率监视器,健身设备,等等

7.作为GATTclient或GATT服务端

使用这些APIs来完毕蓝牙之间的交流,一个应用程序必须声明权限。对于一些额外的功能。如请求设备发现,也须要权限。

提示:不是全部的Android设备都提供了Bluetooth功能。

The Bluetooth APIs let applications:

Scan for other Bluetooth devices (including BLE devices).

Query the local Bluetooth adapter for paired Bluetooth devices.

Establish RFCOMM channels/sockets.

Connect to specified sockets on other devices.

Transfer data to and from other devices.

Communicate with BLE devices, such as proximity sensors, heart rate monitors, fitness devices, and so on.

Act as a GATT client or a GATT server (BLE).

To perform Bluetooth communication using these APIs, an application must declare the  permission. Some additional functionality, such as requesting device discovery, also requires the  permission.

Note: Not all Android-powered devices provide Bluetooth functionality.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zgjdwg.html