android - 我可以通过蓝牙同时向多个设备发送消息吗?

标签 android android-layout android-intent bluetooth android-bluetooth

我使用的代码是:

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);

我如何调整它以同时将数据发送到多个设备?

最佳答案

是的,这几乎是可能的。 官方蓝牙规范声明 seven/7 是一次可以连接的最大蓝牙设备数。大约 248 是配对设备的限制

但是,三到四个设备是一个实际限制,具体取决于所使用的设备类型和配置文件。某些配置文件需要更多蓝牙数据,因此它们比其他配置文件要求更高。数据密集型配置文件可能会减少可同时处于 Activity 状态的设备总数。如果蓝牙设备连接速度变慢或运行不可靠,请减少连接设备的总数。

查看此 answer这对你有帮助

关于android - 我可以通过蓝牙同时向多个设备发送消息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29282939/

相关文章:

java - 自定义 TextView 不显示文本但仅显示背景

Android RatingBar - 一团糟

android - 为什么应用程序崩溃,当我尝试通过自定义样式设置文本大小属性时

Android 即时应用程序 : showInstallPrompt's postInstallIntent does nothing?

android - 有什么方法可以查询特定类型的支持 Intent Filter 的应用程序吗?

javascript - react-native 和 react-navigation 无法将函数作为参数传递到 NavigationOptions 中的下一个屏幕

android - 如何正确地将数据从Android发送到Flutter?

android - 将 View 与缩放的 ImageView 对齐

android - 试图在另一个 Activity 中将两个 EditTexts 的产品显示为 TextView

java - 如何将复杂的 hashmap 转换为 arrayList