Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Bluetooth Connection - Service Discovery Failed
    primarykey
    data
    text
    <p>I'm trying to create a basic bluetooth application, for testing the device. </p> <p>I got the code from developer.android. Here is the link : <a href="http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingDevices" rel="nofollow noreferrer">http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingDevices</a></p> <p>Here is run part of my thread code:</p> <pre><code> 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; } </code></pre> <p>Whatever I have tried <code>mmSocket.connect();</code> never works. Always throws an IOException and I get that log from my logcat: </p> <p><code>java.io.IOException: Service discovery failed<br> at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:403)<br> at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:213)</code></p> <p>I've looked at these articles, and tried the written things, none of them has solved my problem.</p> <p><a href="https://stackoverflow.com/questions/9849852/android-bluetooth-service-discovery-failed-connection-to-desktop-laptop">Android Bluetooth: Service Discovery Failed, connection to Desktop/Laptop</a></p> <p><a href="https://stackoverflow.com/questions/3397071/service-discovery-failed-exception-using-bluetooth-on-android">Service discovery failed exception using Bluetooth on Android </a></p> <p><a href="https://stackoverflow.com/questions/11082819/bluetooth-connection-on-android-ics-not-possible">Bluetooth connection on Android ICS not possible</a></p> <p><a href="https://stackoverflow.com/questions/5298572/android-bluetooth-java-io-ioexception-connection-refused">Android Bluetooth java.io.IOException: Connection refused?</a></p> <p>Btw I'm working on android ics 4.0.4.</p> <p>I know that is not device problem, cause I've tried this app on different devices. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload