to top
Android APIs
Added in API level 5
package

android.bluetooth

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.

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

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 BLUETOOTH permission. Some additional functionality, such as requesting device discovery, also requires the BLUETOOTH_ADMIN permission.

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

Interfaces

BluetoothAdapter.LeScanCallback Callback interface used to deliver LE scan results. 
BluetoothProfile Public APIs for the Bluetooth Profiles. 
BluetoothProfile.ServiceListener An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service. 

Classes

BluetoothA2dp This class provides the public APIs to control the Bluetooth A2DP profile. 
BluetoothAdapter Represents the local device Bluetooth adapter. 
BluetoothAssignedNumbers Bluetooth Assigned Numbers. 
BluetoothClass Represents a Bluetooth class, which describes general characteristics and capabilities of a device. 
BluetoothClass.Device Defines all device class constants. 
BluetoothClass.Device.Major Defines all major device class constants. 
BluetoothClass.Service Defines all service class constants. 
BluetoothDevice Represents a remote Bluetooth device. 
BluetoothGatt Public API for the Bluetooth GATT Profile. 
BluetoothGattCallback This abstract class is used to implement BluetoothGatt callbacks. 
BluetoothGattCharacteristic Represents a Bluetooth GATT Characteristic

A GATT characteristic is a basic data element used to construct a GATT service, BluetoothGattService

BluetoothGattDescriptor Represents a Bluetooth GATT Descriptor

GATT Descriptors contain additional information and attributes of a GATT characteristic, BluetoothGattCharacteristic

BluetoothGattServer Public API for the Bluetooth GATT Profile server role. 
BluetoothGattServerCallback This abstract class is used to implement BluetoothGattServer callbacks. 
BluetoothGattService Represents a Bluetooth GATT Service

Gatt Service contains a collection of BluetoothGattCharacteristic, as well as referenced services. 

BluetoothHeadset Public API for controlling the Bluetooth Headset Service. 
BluetoothHealth Public API for Bluetooth Health Profile. 
BluetoothHealthAppConfiguration The Bluetooth Health Application Configuration that is used in conjunction with the BluetoothHealth class. 
BluetoothHealthCallback This abstract class is used to implement BluetoothHealth callbacks. 
BluetoothManager High level manager used to obtain an instance of an BluetoothAdapter and to conduct overall Bluetooth Management. 
BluetoothServerSocket A listening Bluetooth socket. 
BluetoothSocket A connected or connecting Bluetooth socket.