Android的蓝牙多种连接问题?蓝牙、多种、问题、Android

2023-09-06 02:48:13 作者:残阳

我是新的Andr​​oid中,我工作的一个项目,我不得不与可以通过发现,在所有的设备连接我的设备的 startDiscovery() 通话使用蓝牙。我已经经历了与 蓝牙聊天样品 ,但问题是,对于化妆方面,我需要点击的搜索设备列表中的项目,但我想发送的数据对象列表中的所有设备..是,可能是 listenUsingInsecureComm .. ,?但我没有得到的方式如何配对与其他搜索设备未经允许(接收设备不需要单击是配对)?

I am new in Android, I am working on a project where I have to connect My device with all devices which can be found in by startDiscovery() call Using Bluetooth. I have gone through with bluetooth chat sample, but issue is that for make connection I need to click on item of search-devices in the list, but I want to send data object on all the devices in the list.. is that possible with listenUsingInsecureComm..,? but I am not getting the way how to pair with other search devices without permission (that the receiving device dont need to click Yes for pairing)?

我还参观了相关的问题在这里,但不能让我的解决方案。

I also visited related question here but can't get my solution.

推荐答案

我不知道究竟但根据蓝牙聊天 $ C $下作出更多的连接你必须让 BluetoothDevice类的数组,你也必须管理单独的线程的连接线材。 意味着必须使线程阵列用于从远程设备读取和写入数据和每个线程将只有一个设备相关联的装置,用于装置1有一个线程1和装置2有一个线程2等

I don't know exactly but according to Bluetooth chat code for making a more connection you have to make array of BluetoothDevice and also you have to manage separate threads for all connections. means you have to make array of threads for reading and writing data from remote devices and each thread will associated with only one device means for device 1 there is a thread1 and for device 2 there is a thread 2 and so on.