Android listen for connections without UUID

 ̄綄美尐妖づ 提交于 2019-12-04 16:46:10
Finnboy11

Thanks for Mister Smith by providing me with an answer. With a little research I was able to find an another StackOverflow question with the same subject and a good source file with the soluction I was looking for.

What I basically had to do is to get the BluetoothAdapter with private BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); and then listen for connections with

Method m = adapter.getClass().getMethod("listenUsingRfcommOn", new Class[] { int.class });
BluetoothServerSocket tmp = (BluetoothServerSocket) m.invoke(adapter, 1);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!