Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9873 Discussions

Bluetooth connection with an Android app

MTroj
Novice
1,134 Views

I have to build an Android app using Android Studio that communicate with Edison through Bluetooth. I'm using SPP Verification with RFCOMM and I want to connect Android app to /dev/rfcomm0. My question is which UUID should I use. My android code is simple:

BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();

BluetoothDevice device = ba.getRemoteDevice(mac_address);

UUID uuid = UUID.fromString("8ce255c0-200a-11e0-ac64-0800200c9a66");

BluetoothSocket socket = device.createRfcommSocketToServiceRecord(uuid);

socket.connect();

Is it possible to do this that way?

0 Kudos
1 Solution
idata
Community Manager
143 Views

Hello michalt38,

 

 

Thanks for reaching out!

 

 

You will have to post your Android specific questions in their community ( https://source.android.com/source/community) in order to get more accurate responses.

 

 

However, what I can tell you is how to check your Edison's UUID, enter the following commands:

 

 

rfkill unblock bluetooth

 

bluetoothctl

 

[You will see an entry called controller in the bluetoothctl interface, copy the MAC address of that device]

 

show XX:XX:XX:XX:XX:XX

 

[Use the MAC address of the device called controller, the output of the command above will throw info of that device, including the UUID]

 

 

Anyway, I found a very interesting link that I think might be of help for you:

 

 

https://stackoverflow.com/questions/4632524/how-to-find-the-uuid-of-serial-port-bluetooth-device

 

 

It is about how to get the UUID of a device when it is unknown. I believe it is very suited for your question as it is of Android development and trying to connect through SPP.

 

 

I hope this information helps you,

 

Pedro M.

View solution in original post

1 Reply
idata
Community Manager
144 Views

Hello michalt38,

 

 

Thanks for reaching out!

 

 

You will have to post your Android specific questions in their community ( https://source.android.com/source/community) in order to get more accurate responses.

 

 

However, what I can tell you is how to check your Edison's UUID, enter the following commands:

 

 

rfkill unblock bluetooth

 

bluetoothctl

 

[You will see an entry called controller in the bluetoothctl interface, copy the MAC address of that device]

 

show XX:XX:XX:XX:XX:XX

 

[Use the MAC address of the device called controller, the output of the command above will throw info of that device, including the UUID]

 

 

Anyway, I found a very interesting link that I think might be of help for you:

 

 

https://stackoverflow.com/questions/4632524/how-to-find-the-uuid-of-serial-port-bluetooth-device

 

 

It is about how to get the UUID of a device when it is unknown. I believe it is very suited for your question as it is of Android development and trying to connect through SPP.

 

 

I hope this information helps you,

 

Pedro M.
Reply