【问题】
折腾:
期间,参考:
参考“Connecting as a client”中的:
tmp = device.createRfcommSocketToServiceRecord(MY_UUID);
遇到UUID不懂的问题。
然后随便去
弄了个UUID:
e214d9ae-c3ba-4e25-abb5-299041353bc3
结果运行到:
try {
// Connect the device through the socket. This will block
// until it succeeds or throws an exception
mmSocket.connect();
} catch (IOException connectException) {
// Unable to connect; close the socket and get out
try {
mmSocket.close();
} catch (IOException closeException) { }
return;
}
中的:
mmSocket.connect();
时就抛异常了。
即:
遇到createRfcommSocketToServiceRecord的UUID不懂,以及BluetoothSocket的connect失败。
【解决过程】
1.参考:
去试试:
Meth