Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Bluetooth - Can't connect out
    primarykey
    data
    text
    <p>I am developing an application which uses Bluetooth to connect to a device and send/receive data. I am doing all of my testing with a Nexus One phone.</p> <p>I have never been able to establish a SPP (serial port) connection from my phone to any device. However, I <b>have</b> been able to connect from a device (my laptop) to my phone using a Mac equivalent of PuTTY (The only exception to this is the "Bluetooth File Transfer" app from the Marketplace seems to work, but I don't think that uses RFCOM/SPP...).</p> <p>I keep seeing this message in my LogCat logs:</p> <pre><code>ERROR/BluetoothService.cpp(78): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session) </code></pre> <p>as well as these:</p> <pre><code>java.io.IOException: Operation Canceled java.io.IOException: Software caused connection abort </code></pre> <p></p> <p>I have tried using the UUID of "00001101-0000-1000-8000-00805F9B34FB" and I have also tried using the:</p> <pre><code>Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class }); sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1)); </code></pre> <p>method instead of <code>device.createRfcommSocketToServiceRecord(UUID);</code> as well--with no luck.</p> <p>I am using the <a href="http://developer.android.com/resources/samples/BluetoothChat/index.html" rel="noreferrer">BluetoothChat example</a> and variations of that code to do all of my testing...</p> <p>Solutions or suggestions would be great...or even a better/less complex example of some testing code I can run on the phone, or a python script or something I can run on my computer to help debug?</p> <p>Thanks! I hope this isn't a bug with the Android OS, but if it is I hope to find a workaround.</p> <hr> <p>EDIT: I should also note that most devices show up as "paired, but not connected" in the Bluetooth settings.</p> <hr> <p>EDIT 2: The solution seems to be simply disabling any Bluetooth listening. See my answer post for more information.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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