23

I want to broadcast data from one device using Bluetooth to numerous nearby devices. Now, I know Bluetooth broadcasting exists, but is it possible using Android's existing API? If not, are there any other 3rd party APIs available out there which are capable of it?

Another question regarding Bluetooth broadcasting: Can you start listening to an ongoing broadcast and receive data from it, even if you weren't listening since the broadcast has started? For example, let device A be the broadcaster, and he broadcasts the following data over the course of 5 seconds:

1 2 3 4 5 6 7 8 9 10

Device B received data throughout the entire broadcast, so he received:

1 2 3 4 5 6 7 8 9 10

Device C received started listening only after 2 seconds, while device A was broadcasting 5. Will he receive the rest (5 6 7 8 9 10) as expected?

Jong
  • 9,045
  • 3
  • 34
  • 66
  • Can you confirm that bluetooth broadcasting isn't a recent addition, i.e bluetooth 4. (low energy). if so that would indicate that its perhaps not yet supported. I found it difficult to find any reference to a generic broadcast, most references suggested establishing a connection. – Emile Dec 11 '12 at 16:02
  • 1
    Technically, the "discoverable" mode of a bluetooth device is an example to bluetooth broadcasting, but finding examples to multi-clients broadcasting is almost impossible :( – Jong Dec 11 '12 at 17:03
  • 1
    http://wiresareobsolete.com/wordpress/2010/11/android-bluetooth-rfcomm/ This article explains that bluetooth 4.0.3 now provides to new methods. I'm still haven't found anything that suggests you can broadcast specific data, other than the device name, without having established a connection. – Emile Dec 11 '12 at 17:52
  • I seriously think that you will have to create separate connections to each of the listening devices if you're on Bluetooth 2, broadcasting data, to the best of my knowledge, is only available on Bluetooth 4. It's doable on Bluetooth 2 I think, just a lot more code, and harder. – Shane Hsu Dec 12 '12 at 15:33
  • @jong can you please send me the code of bluetooth broadcasting – Rahil Ali Nov 20 '14 at 18:08
  • @jong did u find any solution for your first question? if so then let me know the solution because i'm doing the same thing in my app...but i couldn't find the solution...Thanx :) – Mitesh Jobanputra Jun 23 '15 at 05:53
  • @Mitesh Jobanputra Sorry, I have not. I don't think it's possible (maybe with newer API... I'm not so up to date with that) – Jong Jun 23 '15 at 22:41
  • @jong its ok....if i find the answer than i will let u know...Happy Coding :) – Mitesh Jobanputra Jun 24 '15 at 06:50
  • Several questions in one post. Please consider split the question. – robermorales May 11 '16 at 14:04
  • Almost 10 years later, and this still isn't really a thing yet. "Bluetooth LE Audio" promises broadcast abilities. Maybe in another 10 years it will be widely available – Greg Woods Sep 15 '21 at 18:32

1 Answers1

2

As packets are not acknowledged during a Bluetooth broadcast, there is no distinction for the master (sender) between a slave node (receiver) that appears later in a broadcast and a slave node that was there from the beginning and didn't receive any packet.

So, yes, the Device C will receive the new packets of data from 5 and up if all general conditions for a bluetooth link are met.

Snicolas
  • 37,840
  • 15
  • 114
  • 173
  • 1
    This answers the second question well. Do you know anything about my first question? – Jong Dec 10 '12 at 17:25
  • Some people seem to do it : http://udm4.com/Android/Bluetooth_Broadcasti-698958 But I can't find anymore things. I will ask an expert tomorrow ? – Snicolas Dec 10 '12 at 18:57
  • I'll have a look at this link, thanks. If you can get any more information, it'd be great. – Jong Dec 10 '12 at 19:00