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

# BluetoothHidDevice

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/bluetooth/BluetoothHidDevice "View this page in Kotlin") \|Java


`
public

final

class
BluetoothHidDevice
`


`

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


`

`


implements

https://developer.android.com/reference/android/bluetooth/BluetoothProfile


`

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

<br />

*** ** * ** ***

Provides the public APIs to control the Bluetooth HID Device profile.

BluetoothHidDevice is a proxy object for controlling the Bluetooth HID Device Service via IPC.
Use `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#getProfileProxy(android.content.Context,%20android.bluetooth.BluetoothProfile.ServiceListener,%20int)` to get the BluetoothHidDevice proxy object.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback` The template class that applications use to call callback functions on events from the HID host. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ACTION_CONNECTION_STATE_CHANGED` Intent used to broadcast the change in connection state of the Input Host profile. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_INVALID_PARAM` Constant representing error response for Set Report due to "invalid parameter". |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_INVALID_RPT_ID` Constant representing error response for Set Report due to "invalid report ID". |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_NOT_READY` Constant representing error response for Set Report due to "not ready". |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_SUCCESS` Constant representing success response for Set Report. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_UNKNOWN` Constant representing error response for Set Report with unknown reason. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#ERROR_RSP_UNSUPPORTED_REQ` Constant representing error response for Set Report due to "unsupported request". |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#PROTOCOL_BOOT_MODE` Constant representing boot protocol mode used set by host. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#PROTOCOL_REPORT_MODE` Constant representing report protocol mode used set by host. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#REPORT_TYPE_FEATURE` Constant representing HID Feature Report type. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#REPORT_TYPE_INPUT` Constant representing HID Input Report type. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#REPORT_TYPE_OUTPUT` Constant representing HID Output Report type. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS1_COMBO` Constant representing combo keyboard and mouse subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS1_KEYBOARD` Constant representing keyboard subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS1_MOUSE` Constant representing mouse subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS1_NONE` Constant representing unspecified HID device subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_CARD_READER` Constant representing card reader subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_DIGITIZER_TABLET` Constant representing digitizer tablet subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_GAMEPAD` Constant representing gamepad subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_JOYSTICK` Constant representing joystick subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_REMOTE_CONTROL` Constant representing remote control subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_SENSING_DEVICE` Constant representing sensing device subclass. |
| `byte` | `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#SUBCLASS2_UNCATEGORIZED` Constant representing uncategorized HID device subclass. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/bluetooth/BluetoothProfile` |---|---| | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#A2DP` Advanced Audio Distribution Profile (A2DP) | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#CSIP_SET_COORDINATOR` Coordinated Set Identification Profile (CSIP) set coordinator | | `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_PREVIOUS_STATE` Extra for the connection state intents of the individual profiles. | | `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_PROFILE` Extra for the `https://developer.android.com/reference/android/bluetooth/BluetoothProfile` that the intent applies to. | | `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_STATE` Extra for the connection state intents of the individual profiles. | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#GATT` Generic Attribute Profile (GATT) | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#GATT_SERVER` Generic Attribute Profile (GATT) Server | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HAP_CLIENT` | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HEADSET` Headset and Handsfree profile | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HEALTH` *This constant was deprecated in API level 29. Health Device Profile (HDP) and MCAP protocol are no longer used. New apps should use Bluetooth Low Energy based solutions such as `https://developer.android.com/reference/android/bluetooth/BluetoothGatt`, `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#listenUsingL2capChannel()`, or `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createL2capChannel(int)`* | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HEARING_AID` Hearing Aid Device | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#HID_DEVICE` Human Interface Device (HID) Device | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#LE_AUDIO` LE Audio Device | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#SAP` SIM Access Profile (SAP) | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED` The profile is in connected state | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTING` The profile is in connecting state | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTED` The profile is in disconnected state | | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTING` The profile is in disconnecting state | |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#connect(android.bluetooth.BluetoothDevice)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device) ` Initiates connection to host which is currently paired with this device. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#disconnect(android.bluetooth.BluetoothDevice)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device) ` Disconnects from currently connected host. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#getConnectedDevices()() ` Get connected devices for this specific profile. 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)`. |
| ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#getConnectionState(android.bluetooth.BluetoothDevice)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device) ` Get the current connection state of the profile 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)`. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#getDevicesMatchingConnectionStates(int[])(int[] states) ` Get a list of devices that match any of the given connection states. 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)`. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)(https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppSdpSettings sdp, https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppQosSettings inQos, https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppQosSettings outQos, https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback callback) ` Registers application to be used for HID device. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#replyReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, byte type, byte id, byte[] data) ` Sends report to remote host as reply for GET_REPORT request from `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onGetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20int)`. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#reportError(android.bluetooth.BluetoothDevice,%20byte)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, byte error) ` Sends error handshake message as reply for invalid SET_REPORT request from `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#sendReport(android.bluetooth.BluetoothDevice,%20int,%20byte[])(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, int id, byte[] data) ` Sends report to remote host using interrupt channel. |
| ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#unregisterApp()() ` Unregisters application. |

| ### 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/bluetooth/BluetoothProfile ` |---|---| | ` abstract https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothProfile#getConnectedDevices()() ` Get connected devices for this specific profile. | | ` abstract int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothProfile#getConnectionState(android.bluetooth.BluetoothDevice)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device) ` Get the current connection state of the profile | | ` abstract https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothProfile#getDevicesMatchingConnectionStates(int[])(int[] states) ` Get a list of devices that match any of the given connection states. | ||

## Constants

### ACTION_CONNECTION_STATE_CHANGED

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

```
public static final String ACTION_CONNECTION_STATE_CHANGED
```

Intent used to broadcast the change in connection state of the Input Host profile.

This intent will have 3 extras:

- `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_STATE` - The current state of the profile.
- `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_PREVIOUS_STATE`- The previous state of the profile.
- `https://developer.android.com/reference/android/bluetooth/BluetoothDevice#EXTRA_DEVICE` - The remote device.

`https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_STATE` or `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#EXTRA_PREVIOUS_STATE` can be any of `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTING`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTING`.


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.hiddevice.profile.action.CONNECTION_STATE_CHANGED"


### ERROR_RSP_INVALID_PARAM

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

```
public static final byte ERROR_RSP_INVALID_PARAM
```

Constant representing error response for Set Report due to "invalid parameter".

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

4
(0x00000004)


### ERROR_RSP_INVALID_RPT_ID

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

```
public static final byte ERROR_RSP_INVALID_RPT_ID
```

Constant representing error response for Set Report due to "invalid report ID".

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

2
(0x00000002)


### ERROR_RSP_NOT_READY

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

```
public static final byte ERROR_RSP_NOT_READY
```

Constant representing error response for Set Report due to "not ready".

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

1
(0x00000001)


### ERROR_RSP_SUCCESS

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

```
public static final byte ERROR_RSP_SUCCESS
```

Constant representing success response for Set Report.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

0
(0x00000000)


### ERROR_RSP_UNKNOWN

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

```
public static final byte ERROR_RSP_UNKNOWN
```

Constant representing error response for Set Report with unknown reason.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

14
(0x0000000e)


### ERROR_RSP_UNSUPPORTED_REQ

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

```
public static final byte ERROR_RSP_UNSUPPORTED_REQ
```

Constant representing error response for Set Report due to "unsupported request".

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`

Constant Value:

3
(0x00000003)


### PROTOCOL_BOOT_MODE

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

```
public static final byte PROTOCOL_BOOT_MODE
```

Constant representing boot protocol mode used set by host. Default is always `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#PROTOCOL_REPORT_MODE` unless notified otherwise.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetProtocol(android.bluetooth.BluetoothDevice,%20byte)`

Constant Value:

0
(0x00000000)


### PROTOCOL_REPORT_MODE

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

```
public static final byte PROTOCOL_REPORT_MODE
```

Constant representing report protocol mode used set by host. Default is always `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#PROTOCOL_REPORT_MODE` unless notified otherwise.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetProtocol(android.bluetooth.BluetoothDevice,%20byte)`

Constant Value:

1
(0x00000001)


### REPORT_TYPE_FEATURE

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

```
public static final byte REPORT_TYPE_FEATURE
```

Constant representing HID Feature Report type.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onGetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20int)`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onInterruptData(android.bluetooth.BluetoothDevice,%20byte,%20byte[])`

Constant Value:

3
(0x00000003)


### REPORT_TYPE_INPUT

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

```
public static final byte REPORT_TYPE_INPUT
```

Constant representing HID Input Report type.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onGetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20int)`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onInterruptData(android.bluetooth.BluetoothDevice,%20byte,%20byte[])`

Constant Value:

1
(0x00000001)


### REPORT_TYPE_OUTPUT

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

```
public static final byte REPORT_TYPE_OUTPUT
```

Constant representing HID Output Report type.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onGetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20int)`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`
- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onInterruptData(android.bluetooth.BluetoothDevice,%20byte,%20byte[])`

Constant Value:

2
(0x00000002)


### SUBCLASS1_COMBO

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

```
public static final byte SUBCLASS1_COMBO
```

Constant representing combo keyboard and mouse subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

-64
(0xffffffc0)


### SUBCLASS1_KEYBOARD

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

```
public static final byte SUBCLASS1_KEYBOARD
```

Constant representing keyboard subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

64
(0x00000040)


### SUBCLASS1_MOUSE

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

```
public static final byte SUBCLASS1_MOUSE
```

Constant representing mouse subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

-128
(0xffffff80)


### SUBCLASS1_NONE

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

```
public static final byte SUBCLASS1_NONE
```

Constant representing unspecified HID device subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

0
(0x00000000)


### SUBCLASS2_CARD_READER

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

```
public static final byte SUBCLASS2_CARD_READER
```

Constant representing card reader subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

6
(0x00000006)


### SUBCLASS2_DIGITIZER_TABLET

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

```
public static final byte SUBCLASS2_DIGITIZER_TABLET
```

Constant representing digitizer tablet subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

5
(0x00000005)


### SUBCLASS2_GAMEPAD

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

```
public static final byte SUBCLASS2_GAMEPAD
```

Constant representing gamepad subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

2
(0x00000002)


### SUBCLASS2_JOYSTICK

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

```
public static final byte SUBCLASS2_JOYSTICK
```

Constant representing joystick subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

1
(0x00000001)


### SUBCLASS2_REMOTE_CONTROL

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

```
public static final byte SUBCLASS2_REMOTE_CONTROL
```

Constant representing remote control subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

3
(0x00000003)


### SUBCLASS2_SENSING_DEVICE

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

```
public static final byte SUBCLASS2_SENSING_DEVICE
```

Constant representing sensing device subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

4
(0x00000004)


### SUBCLASS2_UNCATEGORIZED

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

```
public static final byte SUBCLASS2_UNCATEGORIZED
```

Constant representing uncategorized HID device subclass.

<br />

**See also:**

- `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`

Constant Value:

0
(0x00000000)


## Public methods

### connect

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

```
public boolean connect (BluetoothDevice device)
```

Initiates connection to host which is currently paired with this device. If the application
is not registered, #connect(BluetoothDevice) will fail. The connection state should be
tracked by the application by handling callback from Callback#onConnectionStateChanged. The
connection state is not related to the return value of this method.


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 ||
|---|---|
| `device` | `BluetoothDevice` <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### disconnect

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

```
public boolean disconnect (BluetoothDevice device)
```

Disconnects from currently connected host. The connection state should be tracked by the
application by handling callback from Callback#onConnectionStateChanged. The connection state
is not related to the return value of this method.


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 ||
|---|---|
| `device` | `BluetoothDevice` <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### getConnectedDevices

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

```
public List<BluetoothDevice> getConnectedDevices ()
```

Get connected devices for this specific profile.

Return the set of devices which are in state `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_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 />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | List of devices. The list will be empty on error. <br /> |

### getConnectionState

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

```
public int getConnectionState (BluetoothDevice device)
```

Get the current connection state of the profile


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 ||
|---|---|
| `device` | `BluetoothDevice`: Remote bluetooth device. <br /> |

| Returns ||
|---|---|
| `int` | State of the profile connection. One of `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTING`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTING` Value is one of the following: - `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTED` - `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTING` - `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED` - `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTING` |

### getDevicesMatchingConnectionStates

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

```
public List<BluetoothDevice> getDevicesMatchingConnectionStates (int[] states)
```

Get a list of devices that match any of the given connection states.

If none of the devices match any of the given states, an empty list will be returned.


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 ||
|---|---|
| `states` | `int`: Array of states. States can be one of `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTING`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTED`, `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_DISCONNECTING`, <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | List of devices. The list will be empty on error. <br /> |

### registerApp

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

```
public boolean registerApp (BluetoothHidDeviceAppSdpSettings sdp, 
                BluetoothHidDeviceAppQosSettings inQos, 
                BluetoothHidDeviceAppQosSettings outQos, 
                Executor executor, 
                BluetoothHidDevice.Callback callback)
```

Registers application to be used for HID device. Connections to HID Device are only possible
when application is registered. Only one application can be registered at one time. When an
application is registered, the HID Host service will be disabled until it is unregistered.
When no longer used, application should be unregistered using `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#unregisterApp()`. The
app will be automatically unregistered if it is not foreground. The registration status
should be tracked by the application by handling callback from Callback#onAppStatusChanged.
The app registration status is not related to the return value of this method.


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 ||
|---|---|
| `sdp` | `BluetoothHidDeviceAppSdpSettings`: `https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppSdpSettings` object of HID Device SDP record. The HID Device SDP record is required. <br /> |
| `inQos` | `BluetoothHidDeviceAppQosSettings`: `https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppQosSettings` object of Incoming QoS Settings. The Incoming QoS Settings is not required. Use null or default BluetoothHidDeviceAppQosSettings.Builder for default values. <br /> |
| `outQos` | `BluetoothHidDeviceAppQosSettings`: `https://developer.android.com/reference/android/bluetooth/BluetoothHidDeviceAppQosSettings` object of Outgoing QoS Settings. The Outgoing QoS Settings is not required. Use null or default BluetoothHidDeviceAppQosSettings.Builder for default values. <br /> |
| `executor` | `Executor`: `https://developer.android.com/reference/java/util/concurrent/Executor` object on which callback will be executed. The Executor object is required. <br /> |
| `callback` | `BluetoothHidDevice.Callback`: `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback` object to which callback messages will be sent. The Callback object is required. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### replyReport

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

```
public boolean replyReport (BluetoothDevice device, 
                byte type, 
                byte id, 
                byte[] data)
```

Sends report to remote host as reply for GET_REPORT request from `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onGetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20int)`.


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 ||
|---|---|
| `device` | `BluetoothDevice` <br /> |
| `type` | `byte`: Report Type, as in request. <br /> |
| `id` | `byte`: Report Id, as in request. <br /> |
| `data` | `byte`: Report data, not including Report Id. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### reportError

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

```
public boolean reportError (BluetoothDevice device, 
                byte error)
```

Sends error handshake message as reply for invalid SET_REPORT request from `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice.Callback#onSetReport(android.bluetooth.BluetoothDevice,%20byte,%20byte,%20byte[])`.


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 ||
|---|---|
| `device` | `BluetoothDevice` <br /> |
| `error` | `byte`: Error to be sent for SET_REPORT via HANDSHAKE. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### sendReport

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

```
public boolean sendReport (BluetoothDevice device, 
                int id, 
                byte[] data)
```

Sends report to remote host using interrupt channel.


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 ||
|---|---|
| `device` | `BluetoothDevice` <br /> |
| `id` | `int`: Report Id, as defined in descriptor. Can be 0 in case Report Id are not defined in descriptor. <br /> |
| `data` | `byte`: Report data, not including Report Id. <br /> |

| Returns ||
|---|---|
| `boolean` | true if the command is successfully sent; otherwise false. <br /> |

### unregisterApp

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

```
public boolean unregisterApp ()
```

Unregisters application. Active connection will be disconnected and no new connections will
be allowed until registered again using `https://developer.android.com/reference/android/bluetooth/BluetoothHidDevice#registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20android.bluetooth.BluetoothHidDeviceAppQosSettings,%20java.util.concurrent.Executor,%20android.bluetooth.BluetoothHidDevice.Callback)`. The registration status should be
tracked by the application by handling callback from Callback#onAppStatusChanged. The app
registration status is not related to the return value of this method.


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` | true if the command is successfully sent; otherwise false. <br /> |