0

I want to know whether we can connect 2 Bluetooth devices to the Android device and share data in real-time in Android? i.e I have a sensor connected to the Android device and I want to stream or listen or broadcast the data which is received from Sensor to the Headset(Connected to that same Android device). Is it possible in Android ?? Please suggest. Thanks in advance.

I want to listen to the audio stream over Classic Bluetooth. Is it possible to make an Android device a sink? Currently, we are using HFP profile and Classic Bluetooth for communication.

Scenario: Sensor ->(Bluetooth) -> Android App ->(Bluetooth) -> HeadPhone

the hulk
  • 25
  • 7

1 Answers1

1

Indeed you can however bluetooth communication is wide there is BLE which is from bluetooth 4 and communication is absolutely diferent from the normal earlier bt .i would suggest you take a look at bluetoothchat https://github.com/googlearchive/android-BluetoothChat there is plenty of code to communicate on bt<4 and for BLE check https://github.com/hoyuisun/iGaDs/tree/master/Tibbo_android

Code Demon
  • 1,256
  • 1
  • 9
  • 15
  • Thank you for your help. But I have a question i.e Can we connect 2 devices to Android via Bluetooth? If yes, One of the devices should send data to my Android app and from that, another device should get data from my application whatever the first device sends to the Android app via Bluetooth. Is it possible? Thanks. – the hulk Jun 16 '20 at 09:26
  • 1
    It is possible to have a Bluetooth master device connected to multiple slave devices, but there are limits: Prior to Bluetooth 4.1, Slave devices could only be connected to a single piconet at a time. The reason for this is because when the connection is initiated, the advertising device must synchronize it's clock to that of the initiator. So, a slave device cannot be synchronized to two independent free-running clocks at the same time, hence the one master per slave limit. Bluetooth 4.1 addresses this, so a slave device can be connected to two piconets simultaneously. – Code Demon Jun 16 '20 at 09:48
  • 1
    see this https://stackoverflow.com/a/13510591/8461344 on how to with BLE – Code Demon Jun 16 '20 at 09:48
  • Hi, Is it possible to make an Android device a sink? I want to do live sound streaming over Classic Bluetooth using an HFP profile. – the hulk Feb 28 '22 at 10:00