メッセージ共有ファイルを送信し、bluetooth でチャットできる Android と bluetooth を使用したアプリケーションの開発を終了しました。エラーが表示されるたびに非常に奇妙なアプリケーションであり、それ以外の場合は完全に機能します。これが私の問題のトップです
E/BluetoothEventLoop.cpp(298): onCreateDeviceResult: D-Bus エラー: org.bluez.Error.AlreadyExists (既に存在します)`
2番目のエラー:
サービスの検出に失敗しました[Ljava.lang.StackTraceElement
私のコード:
private BluetoothSocket getLaSocketConnecte(BluetoothDevice myBtServer, UUID uuidToTry)
{
BluetoothSocket myBSock;
try
{
if (BtAdapter.isDiscovering())
{
BtAdapter.cancelDiscovery();
}
myBSock = myBtServer.createRfcommSocketToServiceRecord(uuidToTry);
myBSock.connect();
return myBSock;
} catch (Exception e) {
Log.i(TAG,"IOException . Msg d'erreur :" + e.getMessage()+ e.getStackTrace());
}
return null;
}
そして、ここにログがあります:
04-01 20:38:28.079: I/Connexion(9240): Msg d'erreur : Msg d erreur
:Service discovery failed
04-01 20:38:28.079: I/Connexion(9240): java.io.IOException: Service discovery failed
04-01 20:38:28.079: I/Connexion(9240): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:403)
04-01 20:38:28.079: I/Connexion(9240): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:213)
myBSock.connect();
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.Connexion.getLaSocketConnecte(Connexion.java:190)
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.Connexion.connecterA(Connexion.java:149)
btSock = getLaSocketConnecte(btDevice, uuidList.get(i));
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.Connexion.ConnecterTousLesAppreils(Connexion.java:293)
connecterA(device.getKey());
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.Connexion.EnvoyeBroadcastMsg(Connexion.java:428)
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.Connexion.broadcastMessage(Connexion.java:205)
04-01 20:38:28.079: I/Connexion(9240): at com.Android.Bt.BtPaquetReceiver.onReceive(BtPaquetReceiver.java:28)
解決策を教えてください。
ありがとう :)