我正试图通过手机上的rfcomm bluetooth连接我的cashregister联想A369i使用这样的反射:
BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
BluetoothDevice device = null;
String macAddr = "00:01:90:ED:27:73";
for (BluetoothDevice bd : ba.getBondedDevices())
{
if (bd.getAddress().equals(macAddr))
{
device = bd;
break;
}
}
Method htcMethod = device.getClass().getMethod("createRfcommSocket", new Class[] {int.class});
htcMethod.invoke(device, Integer.valueOf(1));
有时我得到错误“jsr 82连接连接未创建(失败或中止)” 我已经将所有的bletooth权限添加到androidManifest.xml中 我不知道该怎么办,请帮帮我......