Connexion entre android et PC bluetooth applications

Je suis en train de travailler sur une application bluetooth qui implique la connexion de mon android application bluetooth avec un serveur en cours d'exécution sur l'ordinateur. Le serveur est également une application bluetooth faite à l'aide de bleu-anse de l'api.

Le problème, je suis confronté à maintenant que je suis incapable de faire la connexion entre mon application mobile et l'ordinateur serveur d'application.

voici mon code pour l'application android:

 try {
            //Connect the device through the socket. This will block
            //until it succeeds or throws an exception
            mySocket = myDevice.createRfcommSocketToServiceRecord(MY_UUID);
            mySocket.connect();
            toast = Toast.makeText(context, "Connection established",   thisClass.duration);
            toast.show();
          } catch (IOException connectException) {
            //Unable to connect; close the socket and get out
            try {
                mySocket.close();
                toast = Toast.makeText(context, "Connection not established", thisClass.duration);
                toast.show();
            } catch (IOException closeException) { }
            return;
        }

Où est le problème ou qu'est-ce que je suis absent. Et aussi je vais avoir une ambiguïté dans la compréhension de la prise.méthode connect (). De bien vouloir m'aider à cet égard.

OriginalL'auteur Muhammad Salman Farooq | 2012-05-03