Community
cancel
Showing results for 
Search instead for 
Did you mean: 
MTroj
Novice
1,030 Views

Bluetooth connection with an Android app

Jump to solution

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

Accepted Solutions
idata
Community Manager
39 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
40 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