Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#nestedclasses) \| [Constants](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#constants) \| [Inherited Constants](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#inhconstants) \| [Fields](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#lfields) \| [Methods](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/bluetooth/BluetoothDevice#inhmethods)

# BluetoothDevice

*** ** * ** ***


`
public

final

class
BluetoothDevice
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.bluetooth.BluetoothDevice |

<br />

*** ** * ** ***

Represents a remote Bluetooth device. A `https://developer.android.com/reference/android/bluetooth/BluetoothDevice` lets you create a connection with
the respective device or query information about it, such as the name, address, class, and
bonding state.

This class is really just a thin wrapper for a Bluetooth hardware address. Objects of this
class are immutable. Operations on this class are performed on the remote Bluetooth hardware
address, using the `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter` that was used to create this `https://developer.android.com/reference/android/bluetooth/BluetoothDevice`.

To get a `https://developer.android.com/reference/android/bluetooth/BluetoothDevice`, use `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#getRemoteDevice(java.lang.String)` to create one representing a device of a known MAC
address (which you can get through device discovery with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter`) or get one
from the set of bonded devices returned by `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#getBondedDevices()`. You can then open a `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` for
communication with the remote device, using `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createRfcommSocketToServiceRecord(java.util.UUID)` over
Bluetooth BR/EDR or using `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createL2capChannel(int)` over Bluetooth LE.

<br />

### Developer Guides

For more information about using Bluetooth, read the [Bluetooth](https://developer.android.com/guide/topics/connectivity/bluetooth) developer guide.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter`
- `https://developer.android.com/reference/android/bluetooth/BluetoothSocket`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress` A data class for Bluetooth address and address type. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_CONNECTED` Broadcast Action: Indicates a low level (ACL) connection has been established with a remote device. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED` Broadcast Action: Indicates a low level (ACL) disconnection from a remote device. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECT_REQUESTED` Broadcast Action: Indicates that a low level (ACL) disconnection has been requested for a remote device, and it will soon be disconnected. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ALIAS_CHANGED` Broadcast Action: Indicates the alias of a remote device has been changed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` Broadcast Action: Indicates a change in the bond state of a remote device. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_CLASS_CHANGED` Broadcast Action: Bluetooth class of a remote device has changed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` Broadcast Action: Indicates that encryption state changed Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT` Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_STATUS` Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ENABLED` Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_KEY_SIZE` Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ALGORITHM` Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` Broadcast Action: Remote device discovered. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_KEY_MISSING` Broadcast Action: Indicates that previously bonded device couldn't provide keys to establish encryption. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_LE_APPEARANCE_CHANGED` This intent will be broadcasted for bonded devices after LE connection is established, if the LE Appearance value was not known already or changed. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_NAME_CHANGED` Broadcast Action: Indicates the friendly name of a remote device has been retrieved for the first time, or changed since the last retrieval. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` Broadcast Action: This intent is used to broadcast a PAIRING REQUEST. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_UUID` Broadcast Action: This intent is used to broadcast the `https://developer.android.com/reference/java/util/UUID` wrapped as a `https://developer.android.com/reference/android/os/ParcelUuid` of the remote device after it has been fetched. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_ANONYMOUS` Address type used to indicate an anonymous advertisement. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_PUBLIC` Hardware MAC Address of the device |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_RANDOM` Address is either resolvable, non-resolvable or static. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_UNKNOWN` Address type is unknown or unavailable |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDED` Indicates the remote device is bonded (paired). |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDING` Indicates bonding (pairing) is in progress with the remote device. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_AUTH_FAILURE` Indicates the reason for the bond loss is BREDR authentication failure. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_INCOMING_PAIRING` Indicates the reason for the bond loss is BREDR pairing failure. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_ENCRYPT_FAILURE` Indicates the reason for the bond loss is LE encryption failure. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_INCOMING_PAIRING` Indicates the reason for the bond loss is LE pairing failure. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_UNKNOWN` Indicates the reason for the bond loss is unknown. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_NONE` Indicates the remote device is not bonded (paired). |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_CLASSIC` Bluetooth device type, Classic - BR/EDR devices |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_DUAL` Bluetooth device type, Dual Mode - BR/EDR/LE |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_LE` Bluetooth device type, Low Energy - LE-only |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_UNKNOWN` Bluetooth device type, Unknown |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES` Indicates link was encrypted using AES algorithm |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0` Indicates link was encrypted using E0 algorithm |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE` Indicates that link was not encrypted using any algorithm |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN` Indicates link was encrypted using unknown algorithm |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ERROR` Sentinel error value for this class. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_BOND_LOSS_REASON` Contains the reason for the bond loss. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_BOND_STATE` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_CLASS` Used as a Parcelable `https://developer.android.com/reference/android/bluetooth/BluetoothClass` extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_CLASS_CHANGED` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` Used as a Parcelable `https://developer.android.com/reference/android/bluetooth/BluetoothDevice` extra field in every intent broadcast by this class. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DISCOVERY_RESULT_TYPE` Used as an integer field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ALGORITHM` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents as the algorithm used for encryption. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ENABLED` Used as a boolean extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intent. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_STATUS` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intent. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_IS_COORDINATED_SET_MEMBER` Used as a boolean extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_KEY_SIZE` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents as the size of the encryption key, in number of bytes. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` Used as an integer extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_LE_APPEARANCE_CHANGED` intents, and in `ACTION_*_CONNECTION_STATE_CHANGED` intents for audio related profiles. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_NAME` Used as a String extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_NAME_CHANGED` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_ALGORITHM` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents which indicates the pairing algorithm used. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_CONTEXT` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents which indicates the pairing context. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_KEY` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents as the value of passkey. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_VARIANT` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents to indicate pairing method used. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PREVIOUS_BOND_STATE` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_RSSI` Used as an optional short extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT` Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_CONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents to indicate which transport is connected. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` Contains the `https://developer.android.com/reference/android/os/ParcelUuid`s of the remote device which is a parcelable version of `https://developer.android.com/reference/java/util/UUID`. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID_LE` Contains the `https://developer.android.com/reference/android/os/ParcelUuid`s of the remote device which is a parcelable version of `https://developer.android.com/reference/java/util/UUID`. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#LE_APPEARANCE_UNKNOWN` Value indicating that the LE Appearance of the device is unknown. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_BREDR_LEGACY` Indicates usage of the BR/EDR Legacy pairing algorithm. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_BREDR_SSP` Indicates usage of the BR/EDR Secure Simple Pairing (SSP) algorithm. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_LE_LEGACY` Indicates usage of the LE Legacy pairing algorithm. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_SC` Indicates usage of the Secure Connections pairing algorithm, applicable to both BR/EDR and LE transports. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_REPAIRING` Signals an autonomous, system-initiated re-pairing process. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_USER_APPROVAL_REQUESTED` Indicates that the pairing process is initiated, and user approval is requested to complete the pairing process. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_USER_PARTICIPATION_REQUESTED` Signals a request for user participation to begin the LE Legacy pairing process. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PASSKEY_CONFIRMATION` The user will be prompted to confirm the passkey displayed on the screen or an app will confirm the passkey for the user. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PIN` The user will be prompted to enter a pin or an app will enter a pin for user. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_1M` Bluetooth LE 1M PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_1M_MASK` Bluetooth LE 1M PHY mask. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_2M` Bluetooth LE 2M PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_2M_MASK` Bluetooth LE 2M PHY mask. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_CODED` Bluetooth LE Coded PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_CODED_MASK` Bluetooth LE Coded PHY mask. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_HDT` Bluetooth LE HDT PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_HDT_MASK` Bluetooth LE HDT PHY mask. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_OPTION_NO_PREFERRED` No preferred coding when transmitting on the LE Coded PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_OPTION_S2` Prefer the S=2 coding to be used when transmitting on the LE Coded PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_OPTION_S8` Prefer the S=8 coding to be used when transmitting on the LE Coded PHY. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` No preference of physical transport for GATT connections to remote dual-mode devices |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` Constant representing the BR/EDR transport. |
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` Constant representing the Bluetooth Low Energy (BLE) Transport. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that
the Parcelable object's flattened representation includes a file descriptor.


`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written
is a return value, that is the result of a function such as
"`Parcelable someFunction()`",
"`void someFunction(out Parcelable)`", or
"`void someFunction(inout Parcelable)`".


| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#CREATOR` |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#cancelBondProcess()() ` Cancel an in-progress bonding request started with `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createBond()`. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connect()() ` Connects all user enabled and supported bluetooth profiles between the local and remote device. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback)(https://developer.android.com/reference/android/content/Context context, boolean autoConnect, https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback callback) ` *This method was deprecated in API level 37. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.* |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback,%20int,%20int,%20android.os.Handler)(https://developer.android.com/reference/android/content/Context context, boolean autoConnect, https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback callback, int transport, int phy, https://developer.android.com/reference/android/os/Handler handler) ` *This method was deprecated in API level 37. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.* |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback,%20int,%20int)(https://developer.android.com/reference/android/content/Context context, boolean autoConnect, https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback callback, int transport, int phy) ` *This method was deprecated in API level 37. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.* |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)(https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings gattConnectionSettings, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback callback) ` Connect to the GATT Server hosted by the given device. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.content.Context,%20boolean,%20android.bluetooth.BluetoothGattCallback,%20int)(https://developer.android.com/reference/android/content/Context context, boolean autoConnect, https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback callback, int transport) ` *This method was deprecated in API level 37. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.* |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createBond()() ` Start the bonding (pairing) process with the remote device. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createBond(int)(int transport) ` Start the bonding (pairing) process with the remote device using the specified transport. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createInsecureL2capChannel(int)(int psm) ` Create a Bluetooth L2CAP Connection-oriented Channel (CoC) `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` that can be used to start a secure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)(https://developer.android.com/reference/java/util/UUID uuid) ` Create an RFCOMM `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` socket ready to start an insecure outgoing connection to this remote device using SDP lookup of uuid. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createL2capChannel(int)(int psm) ` Create a Bluetooth L2CAP Connection-oriented Channel (CoC) `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` that can be used to start a secure outgoing connection to the remote device with the same dynamic protocol/service multiplexer (PSM) value. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createRfcommSocketToServiceRecord(java.util.UUID)(https://developer.android.com/reference/java/util/UUID uuid) ` Create an RFCOMM `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` ready to start a secure outgoing connection to this remote device using SDP lookup of uuid. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)(https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings settings) ` Creates a client socket to connect to a remote Bluetooth server with the specified socket settings `https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings` This API is used to connect to a remote server hosted using `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)`. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#disconnect()() ` Disconnects all connected bluetooth profiles between the local and remote device. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#disconnectAcl(int)(int transport) ` Disconnects ACL links for this device. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#fetchUuids(int)(int transport) ` Performs a service discovery on the remote device to get the UUIDs supported, allowing the caller to specify the transport. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#fetchUuidsWithSdp()() ` Performs a service discovery on the remote device to get the UUIDs supported. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getAddress()() ` Returns the hardware address of this BluetoothDevice. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getAddressType()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getAlias()() ` Get the locally modifiable name (alias) of the remote Bluetooth device. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothClass` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getBluetoothClass()() ` Get the Bluetooth class of the remote device. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getBondState()() ` This API returns the bond state of the remote device. |
| ` https://developer.android.com/reference/android/bluetooth/BondStatus` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getBondStatus(int)(int transport) ` Returns the bond status of this device. |
| ` https://developer.android.com/reference/android/bluetooth/EncryptionStatus` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getEncryptionStatus(int)(int transport) ` Get the encryption status of the connected device. |
| ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getIdentityAddressWithType()() ` Returns the identity address and identity address type of this BluetoothDevice. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getKeyMissingCount()() ` Get the number of times `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_KEY_MISSING` intent was thrown for this device since the last successful encrypted connection. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getLeAppearance()() ` Get the Bluetooth LE Appearance of the remote device. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getName()() ` Get the friendly Bluetooth name of the remote device. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getType()() ` Get the Bluetooth device type of the remote device. |
| ` https://developer.android.com/reference/android/os/ParcelUuid` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getUuids()() ` Returns the supported features (UUIDs) of the remote device. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#hashCode()() ` Returns a hash code value for the object. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#isConnected(int)(int transport) ` Returns whether there is an open connection to this device on the given transport. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#setAlias(java.lang.String)(https://developer.android.com/reference/java/lang/String alias) ` Sets the locally modifiable name (alias) of the remote Bluetooth device. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#setPairingConfirmation(boolean)(boolean confirm) ` Confirm passkey for `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PASSKEY_CONFIRMATION` pairing. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#setPin(byte[])(byte[] pin) ` *This method was deprecated in API level 37. Only privileged apps should be setting the pin code. General use of this API can interfere with pairing or cause security problems. Use `https://developer.android.com/` instead.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#toString()() ` Returns a string representation of this BluetoothDevice. |
| ` void` | ` https://developer.android.com/reference/android/bluetooth/BluetoothDevice#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel out, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


From interface `

https://developer.android.com/reference/android/os/Parcelable

` `
abstract


int` `
https://developer.android.com/reference/android/os/Parcelable#describeContents()()
`

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.


`
abstract


void` `
https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags)
`

Flatten this object in to a Parcel.


## Constants

### ACTION_ACL_CONNECTED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_ACL_CONNECTED
```

Broadcast Action: Indicates a low level (ACL) connection has been established with a remote
device.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT`.

ACL connections are managed automatically by the Android Bluetooth stack.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.ACL_CONNECTED"


### ACTION_ACL_DISCONNECTED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_ACL_DISCONNECTED
```

Broadcast Action: Indicates a low level (ACL) disconnection from a remote device.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT`.

ACL connections are managed automatically by the Android Bluetooth stack.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.ACL_DISCONNECTED"


### ACTION_ACL_DISCONNECT_REQUESTED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_ACL_DISCONNECT_REQUESTED
```

Broadcast Action: Indicates that a low level (ACL) disconnection has been requested for a
remote device, and it will soon be disconnected.

This is useful for graceful disconnection. Applications should use this intent as a hint
to immediately terminate higher level connections (RFCOMM, L2CAP, or profile connections) to
the remote device.

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED"


### ACTION_ALIAS_CHANGED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_ALIAS_CHANGED
```

Broadcast Action: Indicates the alias of a remote device has been changed.

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.ALIAS_CHANGED"


### ACTION_BOND_STATE_CHANGED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_BOND_STATE_CHANGED
```

Broadcast Action: Indicates a change in the bond state of a remote device. For example, if a
device is bonded (paired).

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_BOND_STATE`, and
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PREVIOUS_BOND_STATE`. From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN`,
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_CONTEXT` will be available. An extra field `https://developer.android.com/`
will be present, if the `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_BOND_STATE` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_NONE`. From the next SDK
release post `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT`
will be available which indicates the transport(s) for which the new bond state applies.
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` will be used if the bond update is applicable for both BREDR and LE
transport, while the specific transport will be used if the bond update is applicable for
only one of the transports.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.BOND_STATE_CHANGED"


### ACTION_CLASS_CHANGED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_CLASS_CHANGED
```

Broadcast Action: Bluetooth class of a remote device has changed.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_CLASS`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothClass`

Constant Value:

"android.bluetooth.device.action.CLASS_CHANGED"


### ACTION_ENCRYPTION_CHANGE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_ENCRYPTION_CHANGE
```

Broadcast Action: Indicates that encryption state changed

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_TRANSPORT`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_STATUS`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ENABLED`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_KEY_SIZE`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_ENCRYPTION_ALGORITHM`


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.ENCRYPTION_CHANGE"


### ACTION_FOUND

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_FOUND
```

Broadcast Action: Remote device discovered.

Sent when a remote device is found during discovery.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_CLASS`. Can
contain the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_NAME` and/or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_RSSI` and/or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_IS_COORDINATED_SET_MEMBER` if they are available.

From `https://developer.android.com/reference/android/os/Build.VERSION_CODES_FULL#BAKLAVA_1`, it contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DISCOVERY_RESULT_TYPE`. Based on the discovery result type, it can contain extra
fields for UUIDs:

- If `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DISCOVERY_RESULT_TYPE` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_CLASSIC`, it can contain `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` for BR/EDR UUIDs.
- If `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DISCOVERY_RESULT_TYPE` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_LE`, it can contain `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID_LE` for LE UUIDs and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` for LE appearance.
- If `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DISCOVERY_RESULT_TYPE` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_DUAL`, it can contain `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` for BR/EDR UUIDs, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID_LE` for LE UUIDs and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` for LE appearance.

`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` includes BR/EDR UUIDs in the extended inquiry response (EIR). A `null` or absent `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` indicates EIR does not include Service Class UUID list.
An empty `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` indicates EIR includes Service Class UUID filed, but the list is
empty.

`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID_LE` includes BLE UUIDs in the BLE advertising data (AD). Specifically,
it includes UUIDs present in SERVICE UUID data type and SERVICE DATA data type, as defined by
Bluetooth Core Specification Supplement (CSS). A `null` or absent `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID_LE` indicates the AD does not include Service UUID or Service DATA. An empty
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` indicates AD includes Service UUID and/or Service DATA, but the list is
empty.

`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` includes the LE Appearance value in the BLE advertising data
(AD). Specifically, it includes the appearance data type, as defined by Bluetooth Core
Specification Supplement (CSS). An `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#LE_APPEARANCE_UNKNOWN` or absent `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` indicates the AD does not include appearance data.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


In addition, this requires the `https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION`
permission. For apps targeting `https://developer.android.com/` or higher, an alternative is a
strong assertion that you will never derive the physical location of the device, made by
declaring `usesPermissionFlags="neverForLocation"` on the relevant `<uses-permission>` manifest tag. However, this assertion may restrict the types of Bluetooth
devices you can interact with.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN`

<br />

Constant Value:

"android.bluetooth.device.action.FOUND"


### ACTION_KEY_MISSING

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_KEY_MISSING
```

Broadcast Action: Indicates that previously bonded device couldn't provide keys to establish
encryption. This can have numerous reasons, i.e.:

- remote was factory reset, or removed bond
- spoofing attack, someone is impersonating remote device
- in case of LE devices, very unlikely address collision

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`

From `https://developer.android.com/reference/android/os/Build.VERSION_CODES#BAKLAVA`, it can contain the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_BOND_LOSS_REASON` which contains the reason for the bond loss. The possible values
are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_AUTH_FAILURE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_INCOMING_PAIRING`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_ENCRYPT_FAILURE`,
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_INCOMING_PAIRING`.

This method requires the calling app to have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission. Before `https://developer.android.com/reference/android/os/Build.VERSION_CODES#BAKLAVA` this method also required `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED`

<br />

Constant Value:

"android.bluetooth.device.action.KEY_MISSING"


### ACTION_LE_APPEARANCE_CHANGED

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String ACTION_LE_APPEARANCE_CHANGED
```

This intent will be broadcasted for bonded devices after LE connection is established, if the
LE Appearance value was not known already or changed.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.LE_APPEARANCE_CHANGED"


### ACTION_NAME_CHANGED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_NAME_CHANGED
```

Broadcast Action: Indicates the friendly name of a remote device has been retrieved for the
first time, or changed since the last retrieval.

Always contains the extra fields `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_NAME`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.NAME_CHANGED"


### ACTION_PAIRING_REQUEST

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_PAIRING_REQUEST
```

Broadcast Action: This intent is used to broadcast a PAIRING REQUEST.

It will contain the following extra fields:

- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_KEY`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_CONTEXT`, post `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN` only
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_PAIRING_ALGORITHM`, post `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN` only

.   
For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.   
For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.   
Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

<br />

Constant Value:

"android.bluetooth.device.action.PAIRING_REQUEST"


### ACTION_UUID

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String ACTION_UUID
```

Broadcast Action: This intent is used to broadcast the `https://developer.android.com/reference/java/util/UUID` wrapped as a `https://developer.android.com/reference/android/os/ParcelUuid` of the remote device after it has been fetched. This intent is sent
only when the UUIDs of the remote device are requested to be fetched using Service Discovery
Protocol

`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` includes UUIDs from both BR/EDR and LE service discovery results. A
`null` `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` indicates a timeout. An empty `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID` indicates
a successful discovery, but zero UUIDs are discovered.

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE`

Always contains the extra field `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_UUID`


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

Constant Value:

"android.bluetooth.device.action.UUID"


### ADDRESS_TYPE_ANONYMOUS

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADDRESS_TYPE_ANONYMOUS
```

Address type used to indicate an anonymous advertisement.

<br />

Constant Value:

255
(0x000000ff)


### ADDRESS_TYPE_PUBLIC

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADDRESS_TYPE_PUBLIC
```

Hardware MAC Address of the device

<br />

Constant Value:

0
(0x00000000)


### ADDRESS_TYPE_RANDOM

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADDRESS_TYPE_RANDOM
```

Address is either resolvable, non-resolvable or static.

<br />

Constant Value:

1
(0x00000001)


### ADDRESS_TYPE_UNKNOWN

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ADDRESS_TYPE_UNKNOWN
```

Address type is unknown or unavailable

<br />

Constant Value:

65535
(0x0000ffff)


### BOND_BONDED

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int BOND_BONDED
```

Indicates the remote device is bonded (paired).

A shared link keys exists locally for the remote device, so communication can be
authenticated and encrypted.

*Being bonded (paired) with a remote device does not necessarily mean the device is currently connected. It just means that the pending procedure was completed at some earlier time, and the link key is still stored locally, ready to use on the next connection. *

<br />

Constant Value:

12
(0x0000000c)


### BOND_BONDING

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int BOND_BONDING
```

Indicates bonding (pairing) is in progress with the remote device.

<br />

Constant Value:

11
(0x0000000b)


### BOND_LOSS_REASON_BREDR_AUTH_FAILURE

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int BOND_LOSS_REASON_BREDR_AUTH_FAILURE
```

Indicates the reason for the bond loss is BREDR authentication failure.

<br />

Constant Value:

1
(0x00000001)


### BOND_LOSS_REASON_BREDR_INCOMING_PAIRING

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int BOND_LOSS_REASON_BREDR_INCOMING_PAIRING
```

Indicates the reason for the bond loss is BREDR pairing failure.

<br />

Constant Value:

2
(0x00000002)


### BOND_LOSS_REASON_LE_ENCRYPT_FAILURE

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int BOND_LOSS_REASON_LE_ENCRYPT_FAILURE
```

Indicates the reason for the bond loss is LE encryption failure.

<br />

Constant Value:

3
(0x00000003)


### BOND_LOSS_REASON_LE_INCOMING_PAIRING

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int BOND_LOSS_REASON_LE_INCOMING_PAIRING
```

Indicates the reason for the bond loss is LE pairing failure.

<br />

Constant Value:

4
(0x00000004)


### BOND_LOSS_REASON_UNKNOWN

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int BOND_LOSS_REASON_UNKNOWN
```

Indicates the reason for the bond loss is unknown.

<br />

Constant Value:

0
(0x00000000)


### BOND_NONE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int BOND_NONE
```

Indicates the remote device is not bonded (paired).

There is no shared link key with the remote device, so communication (if it is allowed at
all) will be unauthenticated and unencrypted.

<br />

Constant Value:

10
(0x0000000a)


### DEVICE_TYPE_CLASSIC

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TYPE_CLASSIC
```

Bluetooth device type, Classic - BR/EDR devices

<br />

Constant Value:

1
(0x00000001)


### DEVICE_TYPE_DUAL

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TYPE_DUAL
```

Bluetooth device type, Dual Mode - BR/EDR/LE

<br />

Constant Value:

3
(0x00000003)


### DEVICE_TYPE_LE

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TYPE_LE
```

Bluetooth device type, Low Energy - LE-only

<br />

Constant Value:

2
(0x00000002)


### DEVICE_TYPE_UNKNOWN

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int DEVICE_TYPE_UNKNOWN
```

Bluetooth device type, Unknown

<br />

Constant Value:

0
(0x00000000)


### ENCRYPTION_ALGORITHM_AES

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENCRYPTION_ALGORITHM_AES
```

Indicates link was encrypted using AES algorithm

<br />

Constant Value:

2
(0x00000002)


### ENCRYPTION_ALGORITHM_E0

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENCRYPTION_ALGORITHM_E0
```

Indicates link was encrypted using E0 algorithm

<br />

Constant Value:

1
(0x00000001)


### ENCRYPTION_ALGORITHM_NONE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ENCRYPTION_ALGORITHM_NONE
```

Indicates that link was not encrypted using any algorithm

<br />

Constant Value:

0
(0x00000000)


### ENCRYPTION_ALGORITHM_UNKNOWN

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int ENCRYPTION_ALGORITHM_UNKNOWN
```

Indicates link was encrypted using unknown algorithm

<br />

Constant Value:

3
(0x00000003)


### ERROR

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int ERROR
```

Sentinel error value for this class. Guaranteed to not equal any other integer constant in
this class. Provided as a convenience for functions that require a sentinel error value, for
example:

`Intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE,
BluetoothDevice.ERROR)`

<br />

Constant Value:

-2147483648
(0x80000000)


### EXTRA_BOND_LOSS_REASON

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String EXTRA_BOND_LOSS_REASON
```

Contains the reason for the bond loss.

Possible values are:
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_UNKNOWN`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_AUTH_FAILURE`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_BREDR_INCOMING_PAIRING`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_ENCRYPT_FAILURE`
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_LOSS_REASON_LE_INCOMING_PAIRING`

<br />

<br />

Constant Value:

"android.bluetooth.device.extra.BOND_LOSS_REASON"


### EXTRA_BOND_STATE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_BOND_STATE
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents. Contains the bond
state of the remote device.

Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_NONE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDING`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDED`.

<br />

Constant Value:

"android.bluetooth.device.extra.BOND_STATE"


### EXTRA_CLASS

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_CLASS
```

Used as a Parcelable `https://developer.android.com/reference/android/bluetooth/BluetoothClass` extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_CLASS_CHANGED` intents.

<br />

Constant Value:

"android.bluetooth.device.extra.CLASS"


### EXTRA_DEVICE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_DEVICE
```

Used as a Parcelable `https://developer.android.com/reference/android/bluetooth/BluetoothDevice` extra field in every intent broadcast by this
class. It contains the `https://developer.android.com/reference/android/bluetooth/BluetoothDevice` that the intent applies to.

<br />

Constant Value:

"android.bluetooth.device.extra.DEVICE"


### EXTRA_DISCOVERY_RESULT_TYPE

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String EXTRA_DISCOVERY_RESULT_TYPE
```

Used as an integer field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. It contains the discovery type for
how the device is found:

- If BR/EDR inquiry result is received, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_CLASSIC`.
- If BLE advertising data is received, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_LE`.
- If both are received, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_DUAL`.

<br />

<br />

Constant Value:

"android.bluetooth.device.extra.DISCOVERY_RESULT_TYPE"


### EXTRA_ENCRYPTION_ALGORITHM

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_ENCRYPTION_ALGORITHM
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents as the algorithm used
for encryption.

Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_NONE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_E0`,
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_AES`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ENCRYPTION_ALGORITHM_UNKNOWN`.

<br />

Constant Value:

"android.bluetooth.device.extra.EXTRA_ENCRYPTION_ALGORITHM"


### EXTRA_ENCRYPTION_ENABLED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_ENCRYPTION_ENABLED
```

Used as a boolean extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intent. false mean
encryption is OFF, true means encryption is ON

<br />

Constant Value:

"android.bluetooth.device.extra.ENCRYPTION_ENABLED"


### EXTRA_ENCRYPTION_STATUS

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_ENCRYPTION_STATUS
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intent. This is the status
value as returned from controller in "HCI Encryption Change event" i.e. value of 0 means
success.

<br />

Constant Value:

"android.bluetooth.device.extra.ENCRYPTION_STATUS"


### EXTRA_IS_COORDINATED_SET_MEMBER

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_IS_COORDINATED_SET_MEMBER
```

Used as a boolean extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. It contains the information
if device is discovered as member of a coordinated set or not. Pairing with device that
belongs to a set would trigger pairing with the rest of set members. See Bluetooth CSIP
specification for more details.

<br />

Constant Value:

"android.bluetooth.extra.IS_COORDINATED_SET_MEMBER"


### EXTRA_KEY_SIZE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_KEY_SIZE
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents as the size of the
encryption key, in number of bytes. i.e. value of 16 means 16-byte, or 128 bit key size.

<br />

Constant Value:

"android.bluetooth.device.extra.KEY_SIZE"


### EXTRA_LE_APPEARANCE

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String EXTRA_LE_APPEARANCE
```

Used as an integer extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_LE_APPEARANCE_CHANGED` intents, and in `ACTION_*_CONNECTION_STATE_CHANGED`
intents for audio related profiles. Contains the LE Appearance of the device.

<br />

Constant Value:

"android.bluetooth.device.extra.LE_APPEARANCE"


### EXTRA_NAME

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_NAME
```

Used as a String extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_NAME_CHANGED` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND`
intents. It contains the friendly Bluetooth name.

<br />

Constant Value:

"android.bluetooth.device.extra.NAME"


### EXTRA_PAIRING_ALGORITHM

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PAIRING_ALGORITHM
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents which indicates the
pairing algorithm used. Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_LE_LEGACY`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_BREDR_LEGACY`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_BREDR_SSP`, and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_ALGORITHM_SC`.

<br />

Constant Value:

"android.bluetooth.device.extra.PAIRING_ALGORITHM"


### EXTRA_PAIRING_CONTEXT

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PAIRING_CONTEXT
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents which indicates the pairing context. Possible values for
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_USER_PARTICIPATION_REQUESTED`,
`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_USER_APPROVAL_REQUESTED`, and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_REPAIRING`,
while the possible value for `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_CONTEXT_REPAIRING`.

<br />

Constant Value:

"android.bluetooth.device.extra.PAIRING_CONTEXT"


### EXTRA_PAIRING_KEY

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PAIRING_KEY
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents as the value of
passkey. The Bluetooth Passkey is a 6-digit numerical value represented as integer value in
the range 0x00000000 \\u2013 0x000F423F (000000 to 999999).

<br />

Constant Value:

"android.bluetooth.device.extra.PAIRING_KEY"


### EXTRA_PAIRING_VARIANT

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PAIRING_VARIANT
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_PAIRING_REQUEST` intents to indicate pairing
method used. Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PIN`, `https://developer.android.com/`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PASSKEY_CONFIRMATION`, `https://developer.android.com/`, `https://developer.android.com/`, `https://developer.android.com/`, `https://developer.android.com/`, `https://developer.android.com/`.

<br />

Constant Value:

"android.bluetooth.device.extra.PAIRING_VARIANT"


### EXTRA_PREVIOUS_BOND_STATE

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_PREVIOUS_BOND_STATE
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents. Contains the
previous bond state of the remote device.

Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_NONE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDING`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDED`.

<br />

Constant Value:

"android.bluetooth.device.extra.PREVIOUS_BOND_STATE"


### EXTRA_RSSI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_RSSI
```

Used as an optional short extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_FOUND` intents. Contains the RSSI
value of the remote device as reported by the Bluetooth hardware.

<br />

Constant Value:

"android.bluetooth.device.extra.RSSI"


### EXTRA_TRANSPORT

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_TRANSPORT
```

Used as an int extra field in `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_CONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED`
and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ENCRYPTION_CHANGE` intents to indicate which transport is connected.
Possible values are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE`.

<br />

Constant Value:

"android.bluetooth.device.extra.TRANSPORT"


### EXTRA_UUID

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String EXTRA_UUID
```

Contains the `https://developer.android.com/reference/android/os/ParcelUuid`s of the remote device which is a parcelable
version of `https://developer.android.com/reference/java/util/UUID`.

An empty EXTRA_UUID indicates the UUIDs are discovered, but zero UUIDs were found.

A `null` or absent EXTRA_UUID indicates the system failed obtain the UUIDs.

<br />

Constant Value:

"android.bluetooth.device.extra.UUID"


### EXTRA_UUID_LE

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final String EXTRA_UUID_LE
```

Contains the `https://developer.android.com/reference/android/os/ParcelUuid`s of the remote device which is a parcelable
version of `https://developer.android.com/reference/java/util/UUID`. Only services discovered for the LE transport is included here.

An empty EXTRA_UUID_LE indicates the UUIDs are discovered, but zero UUIDs were found.

A `null` or absent EXTRA_UUID_LE indicates the system failed obtain the UUIDs.

<br />

Constant Value:

"android.bluetooth.device.extra.UUID_LE"


### LE_APPEARANCE_UNKNOWN

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public static final int LE_APPEARANCE_UNKNOWN
```

Value indicating that the LE Appearance of the device is unknown.

<br />

Constant Value:

0
(0x00000000)


### PAIRING_ALGORITHM_BREDR_LEGACY

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_ALGORITHM_BREDR_LEGACY
```

Indicates usage of the BR/EDR Legacy pairing algorithm. Refer to Bluetooth Core Spec v6.2,
Vol 1, Part A, Section 5 for security requirements and procedure details.

<br />

Constant Value:

1
(0x00000001)


### PAIRING_ALGORITHM_BREDR_SSP

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_ALGORITHM_BREDR_SSP
```

Indicates usage of the BR/EDR Secure Simple Pairing (SSP) algorithm. Refer to Bluetooth Core
Spec v6.2, Vol 1, Part A, Section 5 for security requirements and procedure details.

<br />

Constant Value:

2
(0x00000002)


### PAIRING_ALGORITHM_LE_LEGACY

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_ALGORITHM_LE_LEGACY
```

Indicates usage of the LE Legacy pairing algorithm. Refer to Bluetooth Core Spec v6.2, Vol 1,
Part A, Section 5 for security requirements and procedure details.

<br />

Constant Value:

0
(0x00000000)


### PAIRING_ALGORITHM_SC

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_ALGORITHM_SC
```

Indicates usage of the Secure Connections pairing algorithm, applicable to both BR/EDR and LE
transports. Refer to Bluetooth Core Spec v6.2, Vol 1, Part A, Section 5 for security
requirements and procedure details.

<br />

Constant Value:

3
(0x00000003)


### PAIRING_CONTEXT_REPAIRING

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_CONTEXT_REPAIRING
```

Signals an autonomous, system-initiated re-pairing process. Acceptance replaces the existing
bond; rejection or ignoring preserves it. Failure results in immediate link disconnection and
an `ACTION_KEY_MISSING` intent broadcast.

<br />

Constant Value:

2
(0x00000002)


### PAIRING_CONTEXT_USER_APPROVAL_REQUESTED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_CONTEXT_USER_APPROVAL_REQUESTED
```

Indicates that the pairing process is initiated, and user approval is requested to complete
the pairing process.

<br />

Constant Value:

1
(0x00000001)


### PAIRING_CONTEXT_USER_PARTICIPATION_REQUESTED

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_CONTEXT_USER_PARTICIPATION_REQUESTED
```

Signals a request for user participation to begin the LE Legacy pairing process. Accepting
this allows the Bluetooth stack to proceed toward the formal pairing association model;
rejecting or ignoring it results in immediate pairing failure. Note: This only authorizes the
process to start and does not constitute final pairing approval.

<br />

Constant Value:

0
(0x00000000)


### PAIRING_VARIANT_PASSKEY_CONFIRMATION

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_VARIANT_PASSKEY_CONFIRMATION
```

The user will be prompted to confirm the passkey displayed on the screen or an app will
confirm the passkey for the user.

<br />

Constant Value:

2
(0x00000002)


### PAIRING_VARIANT_PIN

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PAIRING_VARIANT_PIN
```

The user will be prompted to enter a pin or an app will enter a pin for user.

<br />

Constant Value:

0
(0x00000000)


### PHY_LE_1M

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_1M
```

Bluetooth LE 1M PHY. Used to refer to LE 1M Physical Channel for advertising, scanning or
connection.

<br />

Constant Value:

1
(0x00000001)


### PHY_LE_1M_MASK

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_1M_MASK
```

Bluetooth LE 1M PHY mask. Used to specify LE 1M Physical Channel as one of many available
options in a bitmask.

<br />

Constant Value:

1
(0x00000001)


### PHY_LE_2M

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_2M
```

Bluetooth LE 2M PHY. Used to refer to LE 2M Physical Channel for advertising, scanning or
connection.

<br />

Constant Value:

2
(0x00000002)


### PHY_LE_2M_MASK

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_2M_MASK
```

Bluetooth LE 2M PHY mask. Used to specify LE 2M Physical Channel as one of many available
options in a bitmask.

<br />

Constant Value:

2
(0x00000002)


### PHY_LE_CODED

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_CODED
```

Bluetooth LE Coded PHY. Used to refer to LE Coded Physical Channel for advertising, scanning
or connection.

<br />

Constant Value:

3
(0x00000003)


### PHY_LE_CODED_MASK

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_CODED_MASK
```

Bluetooth LE Coded PHY mask. Used to specify LE Coded Physical Channel as one of many
available options in a bitmask.

<br />

Constant Value:

4
(0x00000004)


### PHY_LE_HDT

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_HDT
```

Bluetooth LE HDT PHY. Used to refer to LE High Data Throughput Physical Channel.

<br />

Constant Value:

5
(0x00000005)


### PHY_LE_HDT_MASK

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_LE_HDT_MASK
```

Bluetooth LE HDT PHY mask. Used to specify LE High Data Throughput Physical Channel as one of
many available options in a bitmask.

<br />

Constant Value:

16
(0x00000010)


### PHY_OPTION_NO_PREFERRED

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_OPTION_NO_PREFERRED
```

No preferred coding when transmitting on the LE Coded PHY.

<br />

Constant Value:

0
(0x00000000)


### PHY_OPTION_S2

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_OPTION_S2
```

Prefer the S=2 coding to be used when transmitting on the LE Coded PHY.

<br />

Constant Value:

1
(0x00000001)


### PHY_OPTION_S8

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int PHY_OPTION_S8
```

Prefer the S=8 coding to be used when transmitting on the LE Coded PHY.

<br />

Constant Value:

2
(0x00000002)


### TRANSPORT_AUTO

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TRANSPORT_AUTO
```

No preference of physical transport for GATT connections to remote dual-mode devices

<br />

Constant Value:

0
(0x00000000)


### TRANSPORT_BREDR

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TRANSPORT_BREDR
```

Constant representing the BR/EDR transport.

<br />

Constant Value:

1
(0x00000001)


### TRANSPORT_LE

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int TRANSPORT_LE
```

Constant representing the Bluetooth Low Energy (BLE) Transport.

<br />

Constant Value:

2
(0x00000002)


## Fields

### CREATOR

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<BluetoothDevice> CREATOR
```

<br />

<br />

## Public methods

### cancelBondProcess

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean cancelBondProcess ()
```

Cancel an in-progress bonding request started with `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createBond()`.

BLUETOOTH_PRIVILEGED is enforced only if the calling app didn't initiate bonding.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Returns ||
|---|---|
| `boolean` | true on success, false on error <br /> |

### connect

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int connect ()
```

Connects all user enabled and supported bluetooth profiles between the local and remote
device. If no profiles are user enabled (e.g. first connection), we connect all supported
profiles. If the device is not already connected, this will page the device before initiating
profile connections. Connection is asynchronous and you should listen to each profile's
broadcast intent ACTION_CONNECTION_STATE_CHANGED to verify whether connection was successful.
For example, to verify a2dp is connected, you would listen for `https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#ACTION_CONNECTION_STATE_CHANGED`

This method requires the calling app to have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission. Additionally, an app must either
have `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED` permission or be associated
with the Companion Device manager (see `https://developer.android.com/reference/android/companion/CompanionDeviceManager#associate(android.companion.AssociationRequest,%20android.companion.CompanionDeviceManager.Callback,%20android.os.Handler)`).


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` upon successful initiation of the operation, otherwise an error code. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ENABLED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ALLOWED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_DEVICE_NOT_BONDED` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the device address is invalid |

### connectGatt

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothGatt connectGatt (Context context, 
                boolean autoConnect, 
                BluetoothGattCallback callback)
```


**This method was deprecated
in API level 37.**   

Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.

Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is
used to deliver results to Caller, such as connection status as well as any further GATT
client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to
conduct GATT client operations.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `autoConnect` | `boolean`: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). <br /> |
| `callback` | `BluetoothGattCallback`: GATT callback handler that will receive asynchronous callbacks. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if callback is null |

### connectGatt

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothGatt connectGatt (Context context, 
                boolean autoConnect, 
                BluetoothGattCallback callback, 
                int transport, 
                int phy, 
                Handler handler)
```


**This method was deprecated
in API level 37.**   

Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.

Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is
used to deliver results to Caller, such as connection status as well as any further GATT
client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to
conduct GATT client operations.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `autoConnect` | `boolean`: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). <br /> |
| `callback` | `BluetoothGattCallback`: GATT callback handler that will receive asynchronous callbacks. <br /> |
| `transport` | `int`: preferred transport for GATT connections to remote dual-mode devices `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` <br /> |
| `phy` | `int`: preferred PHY for connections to remote LE device. Bitwise OR of any of `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_1M_MASK`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_2M_MASK`, an d`https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_CODED_MASK`. This option does not take effect if `autoConnect` is set to true. <br /> |
| `handler` | `Handler`: The handler to use for the callback. If `null`, callbacks will happen on an un-specified background thread. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if callback is null |

### connectGatt

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothGatt connectGatt (Context context, 
                boolean autoConnect, 
                BluetoothGattCallback callback, 
                int transport, 
                int phy)
```


**This method was deprecated
in API level 37.**   

Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.

Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is
used to deliver results to Caller, such as connection status as well as any further GATT
client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to
conduct GATT client operations.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `autoConnect` | `boolean`: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). <br /> |
| `callback` | `BluetoothGattCallback`: GATT callback handler that will receive asynchronous callbacks. <br /> |
| `transport` | `int`: preferred transport for GATT connections to remote dual-mode devices `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` <br /> |
| `phy` | `int`: preferred PHY for connections to remote LE device. Bitwise OR of any of `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_1M_MASK`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_2M_MASK`, and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PHY_LE_CODED_MASK`. This option does not take effect if `autoConnect` is set to true. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if callback is null |

### connectGatt

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothGatt connectGatt (BluetoothGattConnectionSettings gattConnectionSettings, 
                Executor executor, 
                BluetoothGattCallback callback)
```

Connect to the GATT Server hosted by the given device. Caller acts as a GATT client. `https://developer.android.com/reference/android/bluetooth/BluetoothGattCallback` of `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings` will deliver results to the
Caller, such as connection updates and GATT client operation results. The method returns a
`https://developer.android.com/reference/android/bluetooth/BluetoothGatt` instance. The application can use BluetoothGatt to conduct GATT client
operations.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `gattConnectionSettings` | `BluetoothGattConnectionSettings`: `https://developer.android.com/reference/android/bluetooth/BluetoothGattConnectionSettings` objects with required gatt settings for the GATT connection. This value cannot be `null`. <br /> |
| `executor` | `Executor`: The executor to use for the callback. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/java/util/concurrent/Executor`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `BluetoothGattCallback`: GATT callback handler that will receive asynchronous callbacks. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | A BluetoothGatt instance. You can use BluetoothGatt to conduct GATT client operations. This value may be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if gattConnectionSettings, callback or executor is null. |

### connectGatt

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothGatt connectGatt (Context context, 
                boolean autoConnect, 
                BluetoothGattCallback callback, 
                int transport)
```


**This method was deprecated
in API level 37.**   

Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#connectGatt(android.bluetooth.BluetoothGattConnectionSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothGattCallback)`.

Connect to GATT Server hosted by this device. Caller acts as GATT client. The callback is
used to deliver results to Caller, such as connection status as well as any further GATT
client operations. The method returns a BluetoothGatt instance. You can use BluetoothGatt to
conduct GATT client operations.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `context` | `Context` <br /> |
| `autoConnect` | `boolean`: Whether to directly connect to the remote device (false) or to automatically connect as soon as the remote device becomes available (true). <br /> |
| `callback` | `BluetoothGattCallback`: GATT callback handler that will receive asynchronous callbacks. <br /> |
| `transport` | `int`: preferred transport for GATT connections to remote dual-mode devices `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothGatt` | <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if callback is null |

### createBond

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean createBond ()
```

Start the bonding (pairing) process with the remote device.

This is an asynchronous call, it will return immediately. Register for `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents to be notified when the bonding process completes, and
its result.

Android system services will handle the necessary user interactions to confirm and
complete the bonding process.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `boolean` | false on immediate error, true if bonding will begin <br /> |

### createBond

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean createBond (int transport)
```

Start the bonding (pairing) process with the remote device using the specified transport.

This is an asynchronous call, it will return immediately. Register for `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_BOND_STATE_CHANGED` intents to be notified when the bonding process completes, and
its result.

Android system services will handle the necessary user interactions to confirm and
complete the bonding process.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `transport` | `int`: The transport to use for the pairing procedure. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `boolean` | false on immediate error, true if bonding will begin <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if an invalid transport was specified |

### createInsecureL2capChannel

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothSocket createInsecureL2capChannel (int psm)
```

Create a Bluetooth L2CAP Connection-oriented Channel (CoC) `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` that can
be used to start a secure outgoing connection to the remote device with the same dynamic
protocol/service multiplexer (PSM) value. The supported Bluetooth transport is LE only.

This is designed to be used with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingInsecureL2capChannel()` for peer-peer Bluetooth applications.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#connect()` to initiate the outgoing connection.

Application using this API is responsible for obtaining PSM value from remote device.

The communication channel may not have an authenticated link key, i.e. it may be subject
to person-in-the-middle attacks. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createL2capChannel(int)` if an encrypted and
authenticated communication channel is possible.

<br />

| Parameters ||
|---|---|
| `psm` | `int`: dynamic PSM value from remote device <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | a CoC #BluetoothSocket ready for an outgoing connection. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | on error, for example Bluetooth not available, or insufficient permissions |

### createInsecureRfcommSocketToServiceRecord

Added in [API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothSocket createInsecureRfcommSocketToServiceRecord (UUID uuid)
```

Create an RFCOMM `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` socket ready to start an insecure outgoing
connection to this remote device using SDP lookup of uuid.

The communication channel will not have an authenticated link key i.e. it will be subject
to person-in-the-middle attacks. For Bluetooth 2.1 devices, the link key will be encrypted,
as encryption is mandatory. For legacy devices (pre Bluetooth 2.1 devices) the link key will
be not be encrypted. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createRfcommSocketToServiceRecord(java.util.UUID)` if an encrypted and
authenticated communication channel is desired.

This is designed to be used with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String,%20java.util.UUID)` for peer-peer Bluetooth
applications.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#connect()` to initiate the outgoing connection. This will also
perform an SDP lookup of the given uuid to determine which channel to connect to.

The remote device will be authenticated and communication on this socket will be
encrypted.

Hint: If you are connecting to a Bluetooth serial board then try using the well-known SPP
UUID 00001101-0000-1000-8000-00805F9B34FB. However if you are connecting to an Android peer
then please generate your own unique UUID.

<br />

| Parameters ||
|---|---|
| `uuid` | `UUID`: service record uuid to lookup RFCOMM channel <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | a RFCOMM BluetoothServerSocket ready for an outgoing connection <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | on error, for example Bluetooth not available, or insufficient permissions |

### createL2capChannel

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothSocket createL2capChannel (int psm)
```

Create a Bluetooth L2CAP Connection-oriented Channel (CoC) `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` that can
be used to start a secure outgoing connection to the remote device with the same dynamic
protocol/service multiplexer (PSM) value. The supported Bluetooth transport is LE only.

This is designed to be used with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingL2capChannel()` for
peer-peer Bluetooth applications.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#connect()` to initiate the outgoing connection.

Application using this API is responsible for obtaining PSM value from remote device.

The remote device will be authenticated and communication on this socket will be
encrypted.

Use this socket if an authenticated socket link is possible. Authentication refers to the
authentication of the link key to prevent person-in-the-middle type of attacks.

<br />

| Parameters ||
|---|---|
| `psm` | `int`: dynamic PSM value from remote device <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | a CoC #BluetoothSocket ready for an outgoing connection. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | on error, for example Bluetooth not available, or insufficient permissions |

### createRfcommSocketToServiceRecord

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothSocket createRfcommSocketToServiceRecord (UUID uuid)
```

Create an RFCOMM `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` ready to start a secure outgoing connection to this
remote device using SDP lookup of uuid.

This is designed to be used with `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingRfcommWithServiceRecord(java.lang.String,%20java.util.UUID)` for peer-peer Bluetooth applications.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#connect()` to initiate the outgoing connection. This will also
perform an SDP lookup of the given uuid to determine which channel to connect to.

The remote device will be authenticated and communication on this socket will be
encrypted.

Use this socket only if an authenticated socket link is possible. Authentication refers to
the authentication of the link key to prevent person-in-the-middle type of attacks. For
example, for Bluetooth 2.1 devices, if any of the devices does not have an input and output
capability or just has the ability to display a numeric key, a secure socket connection is
not possible. In such a case, use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)`. For
more details, refer to the Security Model section 5.2 (vol 3) of Bluetooth Core Specification
version 2.1 + EDR.

Hint: If you are connecting to a Bluetooth serial board then try using the well-known SPP
UUID 00001101-0000-1000-8000-00805F9B34FB. However if you are connecting to an Android peer
then please generate your own unique UUID.

<br />

| Parameters ||
|---|---|
| `uuid` | `UUID`: service record uuid to lookup RFCOMM channel <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | a RFCOMM BluetoothServerSocket ready for an outgoing connection <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | on error, for example Bluetooth not available, or insufficient permissions |

### createUsingSocketSettings

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothSocket createUsingSocketSettings (BluetoothSocketSettings settings)
```

Creates a client socket to connect to a remote Bluetooth server with the specified socket
settings `https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings` This API is used to connect to a remote server
hosted using `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingSocketSettings(android.bluetooth.BluetoothSocketSettings)`.

- For \`BluetoothSocket.TYPE_RFCOMM\`: The RFCOMM UUID must be provided using `https://developer.android.com/`.
- For \`BluetoothSocket.TYPE_LE\`: The L2cap protocol/service multiplexer (PSM) value must be provided using `https://developer.android.com/`.

Application using this API is responsible for obtaining protocol/service multiplexer (psm)
value from remote device.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothSocket#connect()` to initiate the outgoing connection.

<br />

| Parameters ||
|---|---|
| `settings` | `BluetoothSocketSettings`: Bluetooth socket settings `https://developer.android.com/reference/android/bluetooth/BluetoothSocketSettings`. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` | a `https://developer.android.com/reference/android/bluetooth/BluetoothSocket` ready for an outgoing connection. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` | on error, for example Bluetooth not available. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if BluetoothSocket#TYPE_RFCOMM socket with no UUID is passed as input or if BluetoothSocket#TYPE_LE with invalid PSM is passed. |

### describeContents

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### disconnect

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int disconnect ()
```

Disconnects all connected bluetooth profiles between the local and remote device.
Disconnection is asynchronous, so you should listen to each profile's broadcast intent
ACTION_CONNECTION_STATE_CHANGED to verify whether disconnection was successful. For example,
to verify a2dp is disconnected, you would listen for `https://developer.android.com/reference/android/bluetooth/BluetoothA2dp#ACTION_CONNECTION_STATE_CHANGED`. Once all profiles have disconnected, the ACL
link should come down and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED` should be broadcast.

In the rare event that one or more profiles fail to disconnect, call this method again to
send another request to disconnect each connected profile.

This method requires the calling app to have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission. Additionally, an app must either
have both `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED` or be associated with the
Companion Device manager (see `https://developer.android.com/reference/android/companion/CompanionDeviceManager#associate(android.companion.AssociationRequest,%20android.companion.CompanionDeviceManager.Callback,%20android.os.Handler)`).


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` upon successful initiation of the operation, otherwise an error code. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ENABLED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ALLOWED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_DEVICE_NOT_BONDED` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the device address is invalid |

### disconnectAcl

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int disconnectAcl (int transport)
```

Disconnects ACL links for this device.

If `transport` is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO`, it disconnects all ACL links for the
device. Otherwise, it disconnects the ACL link for the specified transport.

Disconnection is asynchronous, so apps should listen to `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_ACL_DISCONNECTED`
to verify whether disconnection was successful.

This method requires the calling app to have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission. Additionally, an app must either
have `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED` or have a Companion Device
Manager association with this device (see `https://developer.android.com/reference/android/companion/CompanionDeviceManager#associate(android.companion.AssociationRequest,%20android.companion.CompanionDeviceManager.Callback,%20android.os.Handler)`).


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Parameters ||
|---|---|
| `transport` | `int`: the transport to disconnect (e.g. `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE`). Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` upon successful setting, otherwise an error code. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ENABLED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ALLOWED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_DEVICE_NOT_BONDED` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the transport is invalid |

### equals

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object o)
```

Indicates whether some other object is "equal to" this one.


The `equals` method implements an equivalence relation
on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.


An equivalence relation partitions the elements it operates on
into *equivalence classes*; all the members of an
equivalence class are equal to each other. Members of an
equivalence class are substitutable for each other, at least
for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### fetchUuids

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean fetchUuids (int transport)
```

Performs a service discovery on the remote device to get the UUIDs supported, allowing the
caller to specify the transport.

This API is asynchronous. When discovery completes, the `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_UUID` intent is
sent, containing the UUIDs supported by the remote device for the specified transport(s).
Cached UUIDs may be sent if an error occurs or if discovery is lengthy. Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getUuids()`
to retrieve cached UUIDs without initiating discovery.

The implementation already handles invalid transport arguments by throwing
IllegalArgumentException and returns false when Bluetooth is disabled, covering the contract
verification points.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `transport` | `int`: The transport to use for discovery: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` for Classic Bluetooth (SDP), `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` for Bluetooth Low Energy (GATT), or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` to discover on all applicable transports (typically BR/EDR and LE for dual-mode devices). \* @return False if the check fails, True if the process of initiating an ACL connection to the remote device was started or cached UUIDs will be broadcast with the specific transport. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_AUTO` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `boolean` | <br /> |

### fetchUuidsWithSdp

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean fetchUuidsWithSdp ()
```

Performs a service discovery on the remote device to get the UUIDs supported.

This API is asynchronous and `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_UUID` intent is sent, with the UUIDs supported
by the remote end. If there is an error in getting the SDP records or if the process takes a
long time, or the device is bonding and we have its UUIDs cached, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_UUID` intent
is sent with the UUIDs that is currently present in the cache. Clients should use the `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getUuids()` to get UUIDs if service discovery is not to be performed. If there is an ongoing
bonding process, service discovery or device inquiry, the request will be queued.

To explicitly fetch UUIDs across all transports, use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#fetchUuids(int)` by calling
`fetchUuids(BluetoothDevice.TRANSPORT_AUTO)`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `boolean` | False if the check fails, True if the process of initiating an ACL connection to the remote device was started or cached UUIDs will be broadcast. <br /> |

### getAddress

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getAddress ()
```

Returns the hardware address of this BluetoothDevice.

For example, "00:11:22:AA:BB:CC".

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | Bluetooth hardware address as string <br /> |

### getAddressType

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getAddressType ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | Bluetooth address type. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_PUBLIC` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_RANDOM` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_ANONYMOUS` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_UNKNOWN` |

### getAlias

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getAlias ()
```

Get the locally modifiable name (alias) of the remote Bluetooth device.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the Bluetooth alias, the friendly device name if no alias, or null if there was a problem <br /> |

### getBluetoothClass

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothClass getBluetoothClass ()
```

Get the Bluetooth class of the remote device.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothClass` | Bluetooth class object, or null on error <br /> |

### getBondState

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getBondState ()
```

This API returns the bond state of the remote device.

Note: The bond state returned by this API may not correctly represent the actual bond
state for all transports. To get the correct bond status for a specific transport, use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getBondStatus(int)`

Possible values for the bond state are: `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_NONE`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDING`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#BOND_BONDED`.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `int` | the bond state of the remote device <br /> |

### getBondStatus

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BondStatus getBondStatus (int transport)
```

Returns the bond status of this device.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `transport` | `int`: the transport to get the bond status for. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BondStatus` | The bond status of this device, or null if the device is not bonded. <br /> |

### getEncryptionStatus

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public EncryptionStatus getEncryptionStatus (int transport)
```

Get the encryption status of the connected device. This API will return the encryption state
(if connected). The encryption details are enclosed in a `https://developer.android.com/reference/android/bluetooth/EncryptionStatus` object,
which can be null if the device is not encrypted (or not connected).


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `transport` | `int`: the transport to get the link status for. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/EncryptionStatus` | the encryption status of the device, null if the device is not encrypted or not connected. <br /> |

### getIdentityAddressWithType

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BluetoothDevice.BluetoothAddress getIdentityAddressWithType ()
```

Returns the identity address and identity address type of this BluetoothDevice. An identity
address is a public or static random Bluetooth LE device address that serves as a unique
identifier.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` and `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress` | a `https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress` containing identity address and identity address type. If Bluetooth is not enabled or identity address type is not available, it will return a `https://developer.android.com/reference/android/bluetooth/BluetoothDevice.BluetoothAddress` containing `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ADDRESS_TYPE_UNKNOWN` device for the identity address type. This value cannot be `null`. <br /> |

### getKeyMissingCount

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getKeyMissingCount ()
```

Get the number of times `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_KEY_MISSING` intent was thrown for this device since
the last successful encrypted connection.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `int` | number of times `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_KEY_MISSING` intent was thrown for this device since the last successful encrypted connection <br /> |

### getLeAppearance

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getLeAppearance ()
```

Get the Bluetooth LE Appearance of the remote device.

The LE Appearance values are defined by the Bluetooth SIG and provide a visual
representation of the device type. For a complete list of valid LE Appearance values, refer
to the [Bluetooth
Assigned Numbers](https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Assigned_Numbers/out/en/Assigned_Numbers.pdf) document.

This value is returned from the local cache and can be retrieved even when the device is
disconnected. The value represents a static physical characteristic and typically stays
constant throughout the lifetime of a device.

The cache is populated either by extracting Appearance AD type from LE advertisements
during device discovery prior to pairing, or by performing a GATT read on the GAP service's
Appearance characteristic on first LE connection.

According to the Bluetooth SIG GAP specifications, the Appearance characteristic does not
support GATT notifications/indications. The changes to a device's appearance are only
broadcasted for bonded devices using the `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#ACTION_LE_APPEARANCE_CHANGED` intent
containing the new `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_LE_APPEARANCE` value.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `int` | the LE Appearance value, or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#LE_APPEARANCE_UNKNOWN` if the appearance is unknown or not yet available. <br /> |

### getName

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getName ()
```

Get the friendly Bluetooth name of the remote device.

The local adapter will automatically retrieve remote names when performing a device scan,
and will cache them. This method just returns the name for this device from the cache.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the Bluetooth name, or null if there was a problem. <br /> |

### getType

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getType ()
```

Get the Bluetooth device type of the remote device.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `int` | the device type `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_CLASSIC`, `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_LE` `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_DUAL`. `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#DEVICE_TYPE_UNKNOWN` if it's not available <br /> |

### getUuids

Added in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ParcelUuid[] getUuids ()
```

Returns the supported features (UUIDs) of the remote device.

This method does not start a service discovery procedure to retrieve the UUIDs from the
remote device. Instead, the local cached copy of the service UUIDs are returned.

Use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#fetchUuidsWithSdp()` if fresh UUIDs are desired.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/ParcelUuid` | the supported features (UUIDs) of the remote device, or null on error <br /> |

### hashCode

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
`https://developer.android.com/reference/java/util/HashMap`.


The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### isConnected

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public boolean isConnected (int transport)
```

Returns whether there is an open connection to this device on the given transport.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT`

<br />

| Parameters ||
|---|---|
| `transport` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_BREDR` - `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#TRANSPORT_LE` |

| Returns ||
|---|---|
| `boolean` | True if there is at least one open connection to this device. <br /> |

### setAlias

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int setAlias (String alias)
```

Sets the locally modifiable name (alias) of the remote Bluetooth device. This method
overwrites the previously stored alias. The new alias is saved in local storage so that the
change is preserved over power cycles.

This method requires the calling app to have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission. Additionally, an app must either
have the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED` or be associated with the
Companion Device manager (see `https://developer.android.com/reference/android/companion/CompanionDeviceManager#associate(android.companion.AssociationRequest,%20android.companion.CompanionDeviceManager.Callback,%20android.os.Handler)`).


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Parameters ||
|---|---|
| `alias` | `String`: is the new locally modifiable name for the remote Bluetooth device which must be the empty string. If null, we clear the alias. <br /> |

| Returns ||
|---|---|
| `int` | whether the alias was successfully changed. Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#SUCCESS` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ENABLED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_BLUETOOTH_NOT_ALLOWED` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION` - `https://developer.android.com/reference/android/bluetooth/BluetoothStatusCodes#ERROR_DEVICE_NOT_BONDED` |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the alias is the empty string |

### setPairingConfirmation

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean setPairingConfirmation (boolean confirm)
```

Confirm passkey for `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PASSKEY_CONFIRMATION` pairing.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.


Requires `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` and `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED`

<br />

| Parameters ||
|---|---|
| `confirm` | `boolean` <br /> |

| Returns ||
|---|---|
| `boolean` | true confirmation has been sent out false for error <br /> |

### setPin

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean setPin (byte[] pin)
```


**This method was deprecated
in API level 37.**   

Only privileged apps should be setting the pin code. General use of this API can
interfere with pairing or cause security problems. Use `https://developer.android.com/` instead.

Set the pin during pairing when the pairing method is `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#PAIRING_VARIANT_PIN`

When the calling application targets API level 37 or higher, `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_PRIVILEGED` is required.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R` or lower, this requires the `https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADMIN` permission which can be gained with a simple `<uses-permission>` manifest tag.


For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#S` or or higher, this requires the
`https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT` permission which can be gained with `https://developer.android.com/reference/android/app/Activity#requestPermissions(java.lang.String[],%20int)`.

<br />

| Parameters ||
|---|---|
| `pin` | `byte` <br /> |

| Returns ||
|---|---|
| `boolean` | true pin has been set false for error <br /> |

### toString

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of this BluetoothDevice.

For apps targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE` (API level 34)
or higher, this returns the MAC address of the device redacted by replacing the hexadecimal
digits of leftmost 4 bytes (in big endian order) with "XX", e.g., "XX:XX:XX:XX:12:34". For
apps targeting earlier versions, the MAC address is returned without redaction.

Warning: The return value of `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#toString()` may change in the future. It is intended
to be used in logging statements. Thus apps should never rely on the return value of `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#toString()` in their logic. Always use other appropriate APIs instead (e.g., use `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#getAddress()` to get the MAC address).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | string representation of this BluetoothDevice <br /> |

### writeToParcel

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel out, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `out` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |