Android.Bluetooth.BluetoothDevice.CreateRfcommSocketToServiceRecord Method
Create an RFCOMM Android.Bluetooth.BluetoothSocket ready to start a secure outgoing connection to this remote device using SDP lookup of uuid.

Syntax

[Android.Runtime.Register("createRfcommSocketToServiceRecord", "(Ljava/util/UUID;)Landroid/bluetooth/BluetoothSocket;", "")]
public BluetoothSocket CreateRfcommSocketToServiceRecord (Java.Util.UUID uuid)

Parameters

uuid
service record uuid to lookup RFCOMM channel

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.IO.IOExceptionon error, for example Bluetooth not available, or insufficient permissions

Remarks

Create an RFCOMM Android.Bluetooth.BluetoothSocket ready to start a secure outgoing connection to this remote device using SDP lookup of uuid.

This is designed to be used with BluetoothAdapter.ListenUsingRfcommWithServiceRecord(string, Java.Util.UUID) for peer-peer Bluetooth applications.

Use BluetoothSocket.Connect to initiate the outgoing connection. This will also perform an SDP lookup of the given uuid to determine which channel to connect to.

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

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

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

Requires NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#BLUETOOTH

[Android Documentation]

Requirements

Namespace: Android.Bluetooth
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 5