I have an android phone and a barcode scanner. To use the scanner I pair it with the phone but in my application I want to a some point to disconnect the scanner, so to do this I thought that an unpair would be enough. I tried the accepted answer from here but it doesn't work. Maybe the BluetoothDevice object it's not correct?
String mac = BluetoothAdapter.getDefaultAdapter().getAddress();
BluetoothDevice bluetoothDevice = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(mac);
Actually I didn't understand what address to put in getRemoteDevice() method so I put the phone bluetooth mac address. Should I put there other address? I would appreciate any answer.
Thank you in advance