Share via


BluetoothHidDevice.Connect(BluetoothDevice) Method

Definition

Initiates connection to host which is currently paired with this device.

[Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;)Z", "", ApiSince=28)]
[Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")]
public bool Connect (Android.Bluetooth.BluetoothDevice? device);
[<Android.Runtime.Register("connect", "(Landroid/bluetooth/BluetoothDevice;)Z", "", ApiSince=28)>]
[<Android.Runtime.RequiresPermission("android.permission.BLUETOOTH_CONNECT")>]
member this.Connect : Android.Bluetooth.BluetoothDevice -> bool

Parameters

Returns

true if the command is successfully sent; otherwise false.

Attributes

Remarks

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.

Java documentation for android.bluetooth.BluetoothHidDevice.connect(android.bluetooth.BluetoothDevice).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to