2

I am developing an application where I have to connect to Bluetooth device on Android 4.3.

I can get the device-A that I have paireduse by using getBondedDevices().

But this device-A is connect via bluetooth in android->config->bluetooth, not

Does the Android 4.3 BLE 4.0 also use the getBondedDevices() to get the device that I have paired ??

or it has other method to get the pair Devices in BT 4.0 and API 18 ??

Wun
  • 6,211
  • 11
  • 56
  • 101

1 Answers1

0

Here is how to get the bonded devices :

BluetoothManager mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);

if (mBluetoothManager != null) {
    BluetoothAdapter mBtAdapter = mBluetoothManager.getAdapter();
    if (mBtAdapter != null) {
        final Set <BluetoothDevice> bonded = mBtAdapter.getBondedDevices();
    }
}
Armel Larcier
  • 15,747
  • 7
  • 68
  • 89