# Configure and Pair Socket Mobile Devices in Application Mode

Step-by-step guide for pairing Socket Mobile Bluetooth barcode scanners and contactless readers in Application Mode without the Companion app. Explains that Bluetooth Classic differs from BLE because the scanner initiates the connection to the host. Covers configuration barcode scanning for Application Mode setup, device pairing procedures, and platform-specific pairing instructions.

> **Note**
>
> The way Bluetooth Classic works, the scanner initiates the connection to the host device. On the contrary of Bluetooth Low Energy where an application initiates the connection.

## Configure and Pair Scanners in Application Mode

To use the scanner with an application using CaptureSDK, the scanner must be configured in Application Mode.

The following barcode will configure your scanner into Application Mode:

## iOS

![Configuration Barcode for iOS Application Mode](/iAP1d.png)

> **Note**
>
> This configuration barcode is persistent across power cycling the scanner and needs to be scanned only once. The scanner will stay in that mode until it is reset to its factory defaults, or until the keyboard emulation (HID) barcode is scanned.

## Connecting/Pairing the Barcode Scanner to the Host

Before you start pairing, make sure that there is no previous pairing saved in the host or in the barcode scanner. If the scanner has been paired with the device before, the pairing can be cleared following these steps:

1. Turn on the scanner
2. Press the power button while pressing the scan button
3. Wait for the scanner to turn off
4. A series of 3 beeps will confirm the pairing information has been deleted. If these 3 beeps are not heard, retry these steps until you hear the 3 beeps.

To connect the scanner to the host, turn it on and go to the host Bluetooth Settings, select the scanner from the list of the Other Devices to pair to it.

If the scanner has been paired with the device before, first you need to select the scanner from the My Devices list, and choose to Forget the Device.

## Bluetooth Classic Discovery

Launch the discovery for Bluetooth Classic devices. Depending on the platform, the connection flow might be different.

> **Note**
>
> The Bluetooth Classic discovery can be launched right after the opening of the CaptureSDK.
>
> Devices will connect automatically and you will be notified with the <b>device arrival event</b> — delivered by <b>CaptureHelper</b> on iOS, C#, JavaScript and Dart, or as the <b>DeviceStateEvent</b> EventBus event on Android — and they will also connect automatically the next times.

## Java

```java
byte deviceType = (byte) BluetoothDiscoveryMode.BLUETOOTH_CLASSIC;

mCaptureClient.addDevice(deviceType, new PropertyCallback() {
    @Override
    public void onComplete(@Nullable CaptureError error, @Nullable Property property) {
        // Bluetooth Classic discovery launched
    }
});
```

## Kotlin

```kotlin
val deviceType: Byte = BluetoothDiscoveryMode.BLUETOOTH_CLASSIC.toByte()

mCaptureClient.addDevice(deviceType) { error, property ->
    // Bluetooth Classic discovery launched
}
```

## Swift

```swift
let captureHelper = CaptureHelper.sharedInstance
// Here we start the discovery with 'addBluetoothDevice' and the parameter '.bluetoothClassic'
captureHelper.addBluetoothDevice(.bluetoothClassic , withCompletionHandler: { result in
    print("addBluetoothDevice - Bluetooth Classic: \(result.rawValue)")
})
```

## C#

```csharp
// capture is of type "CaptureHelper" and is initialized
await capture.AddBluetoothDeviceAsync(
    ICaptureProperty.Values.BluetoothDiscoveryMode.kBluetoothClassic);
```

## Dart

```dart
// Classic Bluetooth discovery (for S720, D720, S820...)
await helper.addBluetoothDevice(
  mode: BluetoothDiscoveryMode.bluetoothClassic,
);
```

## JavaScript

```javascript
// Classic Bluetooth discovery (for S720, D720, S820...)
await helper.addBluetoothDevice(BluetoothDiscoveryMode.BluetoothClassic);
```