Reputation: 11
I'm trying to connected to Bluetooth with Socket SPP using my Samsung Galaxy Tablet using UUID of "00001101-0000-1000-8000-00805F9B34FB"
, but that doesn't not work for me.
And I have tried using the following:
Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));
sock.connect();
This is working fine, but everytime I try to connect, it's asking for pairing request PIN, failing of that is leading to failure of bluetooth connection.
How can I set/save the pair information so that it should not prompt pairing request every time I connect.
Upvotes: 1
Views: 1792
Reputation: 23881
I got this problem as well. This is probably Android ICS issue. As a workaround you can use Insecure Socket
Method m = device.getClass().getMethod("createInsecureRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));
sock.connect();
Upvotes: 2
Reputation: 790
You can go to Bluetooth settings on the Android settings menu and permanently pair the device! Have you tried this before?
Upvotes: 1