I'm developing an application for Android and I face an annoying problem. I'm able to found devices which are not paired but can't pair them by any means. I've followed the instructions given on Android website and it doesn't help at all. It's said there that when using the connect
method of a Bluetooth socket if the device is not paired then a dialog will appear but nothing happens. I've then switched to createBond
of BluetoothDevice
which led to the appearance of the dialog on both devices I'm trying to pair (tried with a Windows computer and another Android device) but when I confirm that the passkey is the same Windows tells me an issue occured and nothing happens on Android. What could I've been doing possibly wrong? I'm lost... I've seen lots of developers talking about the same problem in appearance but I haven't found any solution.
Asked
Active
Viewed 271 times
0

David Benoit
- 1
- 2
1 Answers
0
I'd to use the public but hidden method createRfcommSocket
.
socket = (BluetoothSocket) device.getClass().getMethod("createRfcommSocket", new Class[]{int.class}).invoke(device, 1);

David Benoit
- 1
- 2