jaycevi
jaycevi

Reputation: 11

Asking for 'Pairing Request' in android 2.1 when connecting to Bluetooth Socket SPP on Samsung Galaxy

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

Answers (2)

serejja
serejja

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

Roy Samuel
Roy Samuel

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

Related Questions