In some version of Android somewhere, I found the following telling
lines concerning your Exception:
// if (handle == -1) {
// try {
// socket.close();
// } catch (IOException e) {
// }
// throw new IOException("Not able to register SDP
record for " + name);
Now as you see, they are commented out, so it appears that in some
earlier version, they were throwing this exception when they try to
close the socket, but even the close() fails.
I didn't probe deeper into the source code, but I suspect that they
might have had not a lot of control over that close() function, which
is probably low level Bluetooth stuff. That would explain why they
throw the exception.
It does not explain why they throw a -new- exception with that
message, nor does it explain whether or not your version of Android
has these lines commented out or not. But I hope with these hints you
will be able to complete that investigation on your own.
The link is
http://code.google.com/p/backport-android-bluetooth/source/browse/trunk/backport-android-bluetooth201/src/backport/android/bluetooth/BluetoothAdapter.java?r=76
On Feb 1, 4:03 pm, John Lussmyer <[email protected]> wrote:
> All of a sudden my little Bluetooth app is getting an IOException: "Not able
> to register SDP record for <name>"
> <name> is the name I passed to:
>
> tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME,
> MY_UUID);
>
> This code has been working fine for several days. Now it gets that
> exception EVERY time. It doesn't matter if the bluetooth device is on or
> off.
> No code changes.
>
> After rebooting my phone, it started working again.
> So, it seems that I must not be calling a close() (or somesuch). Does that
> exception somehow indicate what I'm doing wrong?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en