I am developing an android game (Target API - 8) which can be played from two android mobiles via bluetooth. Since my app is targeted to API level 8 (android version 2.2) , I cannot go for Insecure connection. But I don't want to have the user intervention for pairing the devices. I found several answers pointing to http://mobisocial.stanford.edu/news/2011/03/bluetooth-reflection-and-legacy-nfc/. Now I have couple of questions on the Bluetooth connectivity.
1) Is the solution provided in the blog safe to use ?? Will it cause any other issue ?? Will it work on all the versions of android (Except ICS which has Insecure Bluetooth connectivity issue) ??
2) Can we create more than one BluetoothSocket objects in our app? Basically what I am trying is :(As referring to the BluetoothChat Demo)
(i) in AcceptThread - run()
method
// Listen to the server socket if we're not connected
while (mState != STATE_CONNECTED) {
try {
// This is a blocking call and will only return on a
// successful connection or an exception
<**Go for InsecureBluetooth connection as mentioned in the blog**>
}catch(IOException e)
{
try {
// This is a blocking call and will only return on a
// successful connection or an exception
<**Go for default secure connection**>
}catch(IOException e)
{
} //next level catch
}//top level catch
}//while
Please let me know if this is possible.