Android.Bluetooth.BluetoothAdapter.ListenUsingRfcommWithServiceRecord Method
Create a listening, secure RFCOMM Bluetooth socket with Service Record.

Syntax

[Android.Runtime.Register("listenUsingRfcommWithServiceRecord", "(Ljava/lang/String;Ljava/util/UUID;)Landroid/bluetooth/BluetoothServerSocket;", "")]
public BluetoothServerSocket ListenUsingRfcommWithServiceRecord (string name, Java.Util.UUID uuid)

Parameters

name
service name for SDP record
uuid
uuid for SDP record

Returns

Documentation for this section has not yet been entered.

Exceptions

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

Remarks

Create a listening, secure RFCOMM Bluetooth socket with Service Record.

A remote device connecting to this socket will be authenticated and communication on this socket will be encrypted.

Use BluetoothServerSocket.Accept to retrieve incoming connections from a listening Android.Bluetooth.BluetoothServerSocket.

The system will assign an unused RFCOMM channel to listen on.

The system will also register a Service Discovery Protocol (SDP) record with the local SDP server containing the specified UUID, service name, and auto-assigned channel. Remote Bluetooth devices can use the same UUID to query our SDP server and discover which channel to connect to. This SDP record will be removed when this socket is closed, or if this application closes unexpectedly.

Use BluetoothDevice.CreateRfcommSocketToServiceRecord(Java.Util.UUID) to connect to this socket from another device using the same Java.Util.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