Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to establish more than one bluetooth communication in android

I have android application the scan a Bluetooth device around, and connect them to start exchanging text.

I want the application to establish a communication with each Bluetooth device in the surrounding area and send text to all of them at once.

Is that possible to have multiple communication in android ? and if you have any examples ?

like image 959
Adham Avatar asked Nov 12 '22 16:11

Adham


1 Answers

For sure it is possible. You are talking about Bluetooth BR/EDR (2.x, 3.0) or Bluetooth low energy(4.0)?

For Bluetooth BR/EDR, use the official documentation to get started.

  1. Just do a SDP to find all devices in range that support your UUID. Here is how.
  2. Then connect to each of them using a RFCOMM Connection as a client.

Obviously, the other devices should accept this connection. If those are Android as well, see the 'connecting as a server' chapter. (Basically it means waiting for a connection...).

For things not covered in the Android Official Documentation, see this.

You can also just take all paired devices, and try to connect to them(obviously only those in range will connect).

like image 185
Radu Avatar answered Nov 15 '22 05:11

Radu