摩托罗拉 Droid x 的蓝牙问题
我正在开发的应用程序需要一点帮助。
简而言之,在我的应用程序中,我将通过蓝牙连接到一台设备(由客户的工程团队开发)以从该设备获取数据。
我使用以下代码进行蓝牙连接。
BluetoothDevice btDevice = _btAdapter.getRemoteDevice(address);
m = btDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
sock = (BluetoothSocket)m.invoke(btDevice, Integer.valueOf(1));
sock.connect();
// m is a Method and sock is BluetoothSocket object.
此代码适用于除 Motoral Droid x 之外的所有设备,
它抛出异常:
java.io.ioException:权限被拒绝。
我尝试了所有论坛,但找不到解决方案。
如果有人有解决方案,请帮助我。
提前致谢
I need a small help for the app I am developing.
In short in my app I will be connecting to one device (which was developed by engineering team of the client) through the bluetooth to get the data from that device.
I have used following code for bluetooth connection.
BluetoothDevice btDevice = _btAdapter.getRemoteDevice(address);
m = btDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
sock = (BluetoothSocket)m.invoke(btDevice, Integer.valueOf(1));
sock.connect();
// m is a Method and sock is BluetoothSocket object.
This code is working with all the devices except Motoral Droid x
It is throwing an exception:
java.io.ioexception : Permission denied.
I tried in all the forums but I could not find a solution for it.
Please help me if any one has the solution for this.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论