Android Bluetooth multiple connection issue?

左心房为你撑大大i 提交于 2019-11-30 14:13:59

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6872451/android-bluetooth-multiple-connection-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!