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

# BluetoothHealth

*** ** * ** ***

` public final class BluetoothHealth `   
` 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.BluetoothHealth |

<br />

*** ** * ** ***

<br />

**This class 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)`

Public API for Bluetooth Health Profile.

BluetoothHealth is a proxy object for controlling the Bluetooth Service via IPC.

How to connect to a health device which is acting in the source role.
- Use `https://developer.android.com/reference/android/bluetooth/BluetoothAdapter#getProfileProxy(android.content.Context,%20android.bluetooth.BluetoothProfile.ServiceListener,%20int)` to get the BluetoothHealth proxy object.
- Create an `https://developer.android.com/reference/android/bluetooth/BluetoothHealth` callback and call `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#registerSinkAppConfiguration(java.lang.String,%20int,%20android.bluetooth.BluetoothHealthCallback)` to register an application configuration
- Pair with the remote device. This currently needs to be done manually from Bluetooth Settings
- Connect to a health device using `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#connectChannelToSource(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothHealthAppConfiguration)`. Some devices will connect the channel automatically. The `https://developer.android.com/reference/android/bluetooth/BluetoothHealth` callback will inform the application of channel state change.
- Use the file descriptor provided with a connected channel to read and write data to the health channel.
- The received data needs to be interpreted using a health manager which implements the IEEE 11073-xxxxx specifications.
- When done, close the health channel by calling `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#disconnectChannel(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothHealthAppConfiguration,%20int)` and unregister the application configuration calling `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#unregisterAppConfiguration(android.bluetooth.BluetoothHealthAppConfiguration)`

  <br />

  ## Summary

  | ### Constants ||
  |---|---|
  | `int` | `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#APP_CONFIG_REGISTRATION_FAILURE` *This constant is deprecated. 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/BluetoothHealth#APP_CONFIG_REGISTRATION_SUCCESS` *This constant is deprecated. 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/BluetoothHealth#APP_CONFIG_UNREGISTRATION_FAILURE` *This constant is deprecated. 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/BluetoothHealth#APP_CONFIG_UNREGISTRATION_SUCCESS` *This constant is deprecated. 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/BluetoothHealth#CHANNEL_TYPE_RELIABLE` *This constant is deprecated. 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/BluetoothHealth#CHANNEL_TYPE_STREAMING` *This constant is deprecated. 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/BluetoothHealth#SINK_ROLE` *This constant is deprecated. 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/BluetoothHealth#SOURCE_ROLE` *This constant is deprecated. 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/BluetoothHealth#STATE_CHANNEL_CONNECTED` *This constant is deprecated. 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/BluetoothHealth#STATE_CHANNEL_CONNECTING` *This constant is deprecated. 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/BluetoothHealth#STATE_CHANNEL_DISCONNECTED` *This constant is deprecated. 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/BluetoothHealth#STATE_CHANNEL_DISCONNECTING` *This constant is deprecated. 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)`* |

  ### 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`

  <br />

  `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/BluetoothHealth#connectChannelToSource(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothHealthAppConfiguration)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration config) ` *This method is deprecated. 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)`* |
  | ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#disconnectChannel(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothHealthAppConfiguration,%20int)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration config, int channelId) ` *This method is deprecated. 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)`* |
  | ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#getConnectedDevices()() ` Get connected devices for the health profile. |
  | ` int` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#getConnectionState(android.bluetooth.BluetoothDevice)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device) ` Get the current connection state of the profile. |
  | ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/bluetooth/BluetoothDevice>` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#getDevicesMatchingConnectionStates(int[])(int[] states) ` Get a list of devices that match any of the given connection states. |
  | ` https://developer.android.com/reference/android/os/ParcelFileDescriptor` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#getMainChannelFd(android.bluetooth.BluetoothDevice,%20android.bluetooth.BluetoothHealthAppConfiguration)(https://developer.android.com/reference/android/bluetooth/BluetoothDevice device, https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration config) ` *This method is deprecated. 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)`* |
  | ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#registerSinkAppConfiguration(java.lang.String,%20int,%20android.bluetooth.BluetoothHealthCallback)(https://developer.android.com/reference/java/lang/String name, int dataType, https://developer.android.com/reference/android/bluetooth/BluetoothHealthCallback callback) ` *This method is deprecated. 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)`* |
  | ` boolean` | ` https://developer.android.com/reference/android/bluetooth/BluetoothHealth#unregisterAppConfiguration(android.bluetooth.BluetoothHealthAppConfiguration)(https://developer.android.com/reference/android/bluetooth/BluetoothHealthAppConfiguration config) ` *This method is deprecated. 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)`* |

  ### 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

  ### APP_CONFIG_REGISTRATION_FAILURE

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

  ```
  public static final int APP_CONFIG_REGISTRATION_FAILURE
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health App Configuration registration failure

  <br />

  Constant Value: 1 (0x00000001)

  ### APP_CONFIG_REGISTRATION_SUCCESS

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

  ```
  public static final int APP_CONFIG_REGISTRATION_SUCCESS
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health App Configuration registration success

  <br />

  Constant Value: 0 (0x00000000)

  ### APP_CONFIG_UNREGISTRATION_FAILURE

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

  ```
  public static final int APP_CONFIG_UNREGISTRATION_FAILURE
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health App Configuration un-registration failure

  <br />

  Constant Value: 3 (0x00000003)

  ### APP_CONFIG_UNREGISTRATION_SUCCESS

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

  ```
  public static final int APP_CONFIG_UNREGISTRATION_SUCCESS
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health App Configuration un-registration success

  <br />

  Constant Value: 2 (0x00000002)

  ### CHANNEL_TYPE_RELIABLE

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

  ```
  public static final int CHANNEL_TYPE_RELIABLE
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Profile - Channel Type used - Reliable

  <br />

  Constant Value: 10 (0x0000000a)

  ### CHANNEL_TYPE_STREAMING

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

  ```
  public static final int CHANNEL_TYPE_STREAMING
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Profile - Channel Type used - Streaming

  <br />

  Constant Value: 11 (0x0000000b)

  ### SINK_ROLE

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

  ```
  public static final int SINK_ROLE
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Profile Sink Role the device talking to the health device.

  <br />

  Constant Value: 2 (0x00000002)

  ### SOURCE_ROLE

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

  ```
  public static final int SOURCE_ROLE
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Profile Source Role - the health device.

  <br />

  Constant Value: 1 (0x00000001)

  ### STATE_CHANNEL_CONNECTED

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

  ```
  public static final int STATE_CHANNEL_CONNECTED
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Channel Connection State - Connected

  <br />

  Constant Value: 2 (0x00000002)

  ### STATE_CHANNEL_CONNECTING

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

  ```
  public static final int STATE_CHANNEL_CONNECTING
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Channel Connection State - Connecting

  <br />

  Constant Value: 1 (0x00000001)

  ### STATE_CHANNEL_DISCONNECTED

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

  ```
  public static final int STATE_CHANNEL_DISCONNECTED
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Channel Connection State - Disconnected

  <br />

  Constant Value: 0 (0x00000000)

  ### STATE_CHANNEL_DISCONNECTING

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

  ```
  public static final int STATE_CHANNEL_DISCONNECTING
  ```

  <br />

  **This constant is deprecated.**   

  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)`

  Health Channel Connection State - Disconnecting

  <br />

  Constant Value: 3 (0x00000003)

  ## Public methods

  ### connectChannelToSource

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

  ```
  public boolean connectChannelToSource (BluetoothDevice device, 
                  BluetoothHealthAppConfiguration config)
  ```

  <br />

  **This method is deprecated.**   

  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)`

  Connect to a health device which has the `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#SOURCE_ROLE`. This is an asynchronous call. If this function returns true, the callback associated with the application configuration will be called.   

  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 />

  | Parameters ||
  |---|---|
  | `device` | `BluetoothDevice`: The remote Bluetooth device. <br /> |
  | `config` | `BluetoothHealthAppConfiguration`: The application configuration which has been registered using `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#registerSinkAppConfiguration(java.lang.String,%20int,%20android.bluetooth.BluetoothHealthCallback)` <br /> |

  | Returns ||
  |---|---|
  | `boolean` | If true, the callback associated with the application config will be called. <br /> |

  ### disconnectChannel

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

  ```
  public boolean disconnectChannel (BluetoothDevice device, 
                  BluetoothHealthAppConfiguration config, 
                  int channelId)
  ```

  <br />

  **This method is deprecated.**   

  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)`

  Disconnect a connected health channel. This is an asynchronous call. If this function returns true, the callback associated with the application configuration will be called.   

  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 />

  | Parameters ||
  |---|---|
  | `device` | `BluetoothDevice`: The remote Bluetooth device. <br /> |
  | `config` | `BluetoothHealthAppConfiguration`: The application configuration which has been registered using `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#registerSinkAppConfiguration(java.lang.String,%20int,%20android.bluetooth.BluetoothHealthCallback)` <br /> |
  | `channelId` | `int`: The channel id associated with the channel <br /> |

  | Returns ||
  |---|---|
  | `boolean` | If true, the callback associated with the application config will be called. <br /> |

  ### getConnectedDevices

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

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

  Get connected devices for the health profile.

  Return the set of devices which are in state `https://developer.android.com/reference/android/bluetooth/BluetoothProfile#STATE_CONNECTED`

  This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for this profile. This can be used by applications like status bar which would just like to know the state of the local adapter.   

  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/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 14](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

  Get the current connection state of the profile.

  This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter with the remote device. This can be used by applications like status bar which would just like to know the state of the local adapter.   

  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 />

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

  ### getDevicesMatchingConnectionStates

  Added in [API level 14](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.

  This is not specific to any application configuration but represents the connection state of the local Bluetooth adapter for this profile. This can be used by applications like status bar which would just like to know the state of the local adapter.   

  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 />

  | 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 /> |

  ### getMainChannelFd

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

  ```
  public ParcelFileDescriptor getMainChannelFd (BluetoothDevice device, 
                  BluetoothHealthAppConfiguration config)
  ```

  <br />

  **This method is deprecated.**   

  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)`

  Get the file descriptor of the main channel associated with the remote device and application configuration.

  It's the responsibility of the caller to close the ParcelFileDescriptor when done.   

  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 />

  | Parameters ||
  |---|---|
  | `device` | `BluetoothDevice`: The remote Bluetooth health device <br /> |
  | `config` | `BluetoothHealthAppConfiguration`: The application configuration <br /> |

  | Returns ||
  |---|---|
  | `https://developer.android.com/reference/android/os/ParcelFileDescriptor` | null on failure, ParcelFileDescriptor on success. <br /> |

  ### registerSinkAppConfiguration

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

  ```
  public boolean registerSinkAppConfiguration (String name, 
                  int dataType, 
                  BluetoothHealthCallback callback)
  ```

  <br />

  **This method is deprecated.**   

  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)`

  Register an application configuration that acts as a Health SINK. This is the configuration that will be used to communicate with health devices which will act as the `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#SOURCE_ROLE`. This is an asynchronous call and so the callback is used to notify success or failure if the function returns true.   

  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 />

  | Parameters ||
  |---|---|
  | `name` | `String`: The friendly name associated with the application or configuration. <br /> |
  | `dataType` | `int`: The dataType of the Source role of Health Profile to which the sink wants to connect to. <br /> |
  | `callback` | `BluetoothHealthCallback`: A callback to indicate success or failure of the registration and all operations done on this application configuration. <br /> |

  | Returns ||
  |---|---|
  | `boolean` | If true, callback will be called. <br /> |

  ### unregisterAppConfiguration

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

  ```
  public boolean unregisterAppConfiguration (BluetoothHealthAppConfiguration config)
  ```

  <br />

  **This method is deprecated.**   

  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)`

  Unregister an application configuration that has been registered using `https://developer.android.com/reference/android/bluetooth/BluetoothHealth#registerSinkAppConfiguration(java.lang.String,%20int,%20android.bluetooth.BluetoothHealthCallback)`   

  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 />

  | Parameters ||
  |---|---|
  | `config` | `BluetoothHealthAppConfiguration`: The health app configuration <br /> |

  | Returns ||
  |---|---|
  | `boolean` | Success or failure. <br /> |