私はアンドロイドブルートゥースアプリケーションとコンピュータ上で動作するサーバとの接続を含むブルートゥースアプリケーションを開発中です。このサーバーは、ブルー・コーブのAPIを使用して作成されたBluetoothアプリケーションです。アンドロイドとPCブルートゥースアプリケーション間の接続
私のモバイルアプリケーションとそのコンピュータサーバーアプリケーションとの間に接続できない問題があります。
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;
}
ある問題や何多分私はそれで行方不明です:
は、ここで私のAndroidアプリのコードです。また、socket.connect()メソッドの理解にあいまいさがあります。この点で私を助けてください。