기기를 테스트하기 위해 기본 블루투스 애플리케이션을 만들려고합니다.Android 블루투스 연결 - 서비스 검색 실패
developer.android에서 코드를 받았습니다. 여기
http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingDevices 내 스레드 코드의 일부를 실행 : 내가 mmSocket.connect();
을 시도간에
public void run() {
mBluetoothAdapter.cancelDiscovery();
Log.i(TAG, "Discovery Cancel!");
try {
Log.i(TAG, "Connection Started");
mmSocket.connect();
Log.i(TAG, "Connection Ended");
} catch (IOException e) {
try {
Log.e(TAG, "Connection Failed", e);
mmSocket.close();
} catch (IOException e2) {
Log.e(TAG, "Connection Close Failed", e2);
}
return;
}
작동하지 여기 링크입니다. 항상 IOException를 던져 내 로그 캣에서 해당 로그를 얻을 : 나는이 기사에보고하고, 기록 된 것들을 시도했습니다
java.io.IOException: Service discovery failed
at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:403)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:213)
, 그들 중 누구도 내 문제를 해결하지 않았다. 안드로이드 ICS 4.0.4에
Android Bluetooth java.io.IOException: Connection refused?
Btw은 내가 일하고 있어요
Bluetooth connection on Android ICS not possible
Service discovery failed exception using Bluetooth on Android
Android Bluetooth: Service Discovery Failed, connection to Desktop/Laptop
.다른 기기에서이 앱을 사용했기 때문에 기기에 문제가 있다는 것을 알고 있습니다.
은 이미 그 코드 샘플을 신청하는 근무,하지만 결과는 항상 동일합니다 ... 그것을 시도. – juliadream