I try to open a socket for listening for incomming connection from a non-android device.
Parcelable[] uuidExtra = device.getUuids();
String t = uuidExtra[
So if anybody is curious about this, or facing the same issue as I did, here is the solution:
The error: Not able to register SDP record for: "name of the device"
will be thrown because you are trying to create a service with a a UUID
that is already taken. In this case, I tried to register my own service, with the same UUID
as the Obex Object Push
What I had to do, is to register my own service, with a custom UUID, for instance
d1b180c0-d7bc-11e1-9b23-0800200c9a66
This UUID is generated from this webpage. As for now you have created a new listening socket:
try {
tmp = adapter.listenUsingInsecureRfcommWithServiceRecord("My Profile", UUID.fromString("d1b180c0-d7bc-11e1-9b23-0800200c9a66"));
} catch (IOException e) {
Log.e("FAILED BECAUSE:", e.getMessage());
}
mmServerSocket = tmp;
And we are now ready to accept incomming requests, this way:
socket = mmServerSocket.accept();
Remeber, this is a blocking call, so for yourself and your users, please put this in a thread
.
So why the heck doesn't my device connect to the android server?
Are you sure that the remote device/client is using the same UUID as the server?
if you cant specify the UUID for the remote device, please contact the manufacture maybe the are nice enough to send you a config file, which is my case.
If there is any questions, please add a comment to this post. I will accept this as an answer since nobody had a solution to this.