1

The code I'm using is:

ContentValues values = new ContentValues(); 
String filePath1 = Environment.getExternalStorageDirectory().toString() + "/filename.txt";
values.put(BluetoothShare.URI, Uri.fromFile(newFile(filePath1)).toString()); 
values.put(BluetoothShare.DESTINATION,itDevices.getAddress());
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND); 
Long ts = System.currentTimeMillis(); 
values.put(BluetoothShare.TIMESTAMP, ts); 
Uri contentUri = getContentResolver().insert(BluetoothShare.CONTENT_URI, values);

How can I adapt this to send data to multiple devices at once?

Emissary
  • 9,954
  • 8
  • 54
  • 65
mohamed adel
  • 11
  • 1
  • 2

2 Answers2

2

Yes, It is pretty much possible. The official Bluetooth specifications state seven/7 is the maximum number of Bluetooth devices that can be connected at once. And around 248 is the limit for paired devices

However, three to four devices is a practical limit, depending on the types of devices and profiles are used. Some profiles require more Bluetooth data, so they are more demanding than other profiles. Data-intensive profiles may reduce the total number of devices that can be active at the same time. If a Bluetooth device becomes slow to connect or does not perform reliably, reduce the total number of connected devices.

See this answer which can be of your help

Community
  • 1
  • 1
AAnkit
  • 27,299
  • 12
  • 60
  • 71
0

You can pair your device(say X) with any number of devices. But if device A is connected with X, device B won't be able to connect at all. You have to disconnect X from A and then connect X with B. Multiple connections at an instant is not allowed.

user2430771
  • 1,326
  • 4
  • 17
  • 33
  • i have app bluetooth chat only one to one i need send word like *hey friend * to group of people have my app ... like in android you send message . you click new message .to(contacts) choose like 10 number and send your message i need to modify code chat to add button have (contacts) after i write my words choose people and send – mohamed adel Mar 26 '15 at 19:15
  • With bluetooth this is not possible because you have to make connection with each device individually and send data. Chatting application makes use of Push Notification Services like Google Cloud Messaging (GCM) and Apple Push Notification Services(APN). that's why they go to every device. You can read about bluetooth on Wiki to understand it's working. – user2430771 Mar 26 '15 at 20:40