I\'m trying to establish a bluetooth connexion between a Samsung Galaxy S3 running with Android 4.0.3 and a RN 42 Bluetooth Chip, here is the model :
I used lot\'s
Your code seems correct, but as Radu said, the new Bluetooth behaviour si not that good.
I did have quite some troubles myself (with Android 4.1+) and finally used BlueTerm as basis for my app, since it is opensource and is working (at least for the connexion part).
You can find its sources here :
http://pymasde.es/blueterm/
I hope it can help you !
D
There are plenty of Bluetooth incompatibility issues with the new Android ICS. Apparently they messed around with the Bluetooth code to 'improve security'.
A bug I found and reported(which made my entire embedded board not able to connect for a week with any Android ICS device) was that when establishing a connection to an already paired device, Android ICS would require re-authentication - with or without PIN depends if you use Bluetooth SSP (I use it - this means that for me, on Android ICS connection of 2 bonded devices is still possible without user interaction - but it takes a bit longer).
Please vote this bug on Google Bugtracker - maybe someone will fix it...
Maybe this is your problem as well? Can you specify exactly at what line your code breaks? Surround all your Bluetooth system code with try/catch, etc.
Anyway, the new Bluetooth behavior is very very bad, I heard of a lot of people not being able to connect to their old headset because of it.