アプリケーションを使用して、クライアントの Bluetooth デバイスを電話にペアリングする作業を行っています。現在、asynctask で次のコードを使用して、リモート デバイス用のソケットを作成しようとしています。
try{
ba.cancelDiscovery();
socket= blud.createRfcommSocketToServiceRecord(uuid);
Method m = blud.getClass().getMethod("createRfcommSocket", new
Class[] {int.class});
socket = (BluetoothSocket) m.invoke(blud, 1);
}catch(Exception e){e.printStackTrace();}
Connect Thread と Accept Thread がある場合の BluetoothChat の例にさらに沿う必要があるかどうか、または asynctasks で十分かどうかはわかりません。
これは私が使用しているUUID文字列です最終的に Permission Denied IO Exception が発生する