简单的描述下分享给大家个demo:
网上找了一大堆,刚开始配对是没问题的,但是断开连接和连接设备就出现很多报错,用的是
BluetoothSocket.connect,发现完全不是同一个方向,一直报错getBluetoothService() called with no BluetoothManagerCallback 或
read failed, socket might closed or timeout, read ret: -1。
连接和断开的蓝牙关键类应该是 BluetoothProfile。
demo链接://download.csdn.net/download/Roshen_android/12194995
本文分享了一个解决蓝牙连接和断开过程中遇到的问题的demo。作者使用BluetoothSocket.connect进行设备连接时,遇到了一系列错误,如getBluetoothService()calledwithnoBluetoothManagerCallback和readfailed等问题。通过使用BluetoothProfile类,成功解决了这些问题。

9057

被折叠的 条评论
为什么被折叠?



