Android Bluetooth not Showing Pairing Dialog

I'm currently having some troubles with Bluetooth (using SPP) on some phones. One thing you could try, is to use reflection when creating the socket.

I've used a Nexus S while developing my Bluetooth service (I'm actually using the listenUsingRfcommWithServiceRecord-method) it works fine on that phone. Also works fine on SonyEricsson Xperia ARC and SonyEricsson X10 Mini Pro. It didn't work on HTC Wildfire (2.2.1), HTC Legend (2.2) nor on Samsung Galaxy S (2.2.1).

I should also mention that the device I'm receiving data from uses Bluetooth 1.2 too, like yours, so that should not be a problem.

When I tried using reflection I suddenly succeeded on the Wildfire, unfortunately still no progress on Legend nor on the Galaxy S. This is where I'm stuck. Many forums claim some manufacturers have a proprietary Bluetooth stack, so I guess this is what's causing these problems. Anyway, good luck!

UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");

Method m = mAdapter.getClass().getMethod("createRfcommSocketToServiceRecord", new Class[] { UUID.class });
tmpSocket = (BluetoothServerSocket) m.invoke(mAdapter, new Object[] { MY_UUID });