connect to device with Bluetooth address on String

后端 未结 3 1501
长发绾君心
长发绾君心 2021-01-04 00:04

I am doing an Android App and where I have the MAC of another device as a string (17 characters long) and need to use that one in order to connect to that device (thread tha

3条回答
  •  一整个雨季
    2021-01-04 00:52

    Convert the String value to Bluetooth Devices.

    BluetoothManager bluetoothManager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
    BluetoothDevice mBluetoothDevice = bluetoothManager.getAdapter() .getRemoteDevice("deviceAddress");
    

提交回复
热议问题