1

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.

JJJ
  • 32,902
  • 20
  • 89
  • 102
Kalmesh Sam
  • 71
  • 2
  • 10
  • possible duplicate of [Insecure bluetooth connectivity in android app(API Level 8)](http://stackoverflow.com/questions/10926097/insecure-bluetooth-connectivity-in-android-appapi-level-8) – JJJ Jul 14 '12 at 10:55
  • I would really double think if it still worth targeting API Level 8. Though I know it's still extremely common in the wild (I use 2.2 myself :C ) you should maybe see if it's not better to change to the newer versions and use support libs. – nuala Jul 14 '12 at 10:57

0 Answers0