2

我正在开发一个应用程序,我必须在其中连接到 Android 4.3 上的蓝牙设备。

我可以使用 getBondedDevices() 来获取我已配对使用的设备 A。

但是这个设备-A是通过android->config->bluetooth中的蓝牙连接的,而不是

Android 4.3 BLE 4.0 是否也使用 getBondedDevices() 来获取我已配对的设备?

或者它有其他方法来获得 BT 4.0 和 API 18 中的配对设备?

4

1 回答 1

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();
    }
}
于 2014-02-15T14:02:37.550 回答