询问“配对请求”在 android 2.1 中连接到 Samsung Galaxy 上的蓝牙插座 SPP 时
我正在尝试使用我的 Samsung Galaxy 平板电脑(使用 UUID 为 “00001101-0000-1000-8000-00805F9B34FB”
)通过 Socket SPP 连接到蓝牙,但这对我不起作用。
我尝试使用以下方法:
Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));
sock.connect();
这工作正常,但每次我尝试连接时,它都会要求配对请求 PIN,失败会导致蓝牙连接失败。
如何设置/保存配对信息,以便每次连接时都不会提示配对请求。
I'm trying to connected to Bluetooth with Socket SPP using my Samsung Galaxy Tablet using UUID of "00001101-0000-1000-8000-00805F9B34FB"
, but that doesn't not work for me.
And I have tried using the following:
Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));
sock.connect();
This is working fine, but everytime I try to connect, it's asking for pairing request PIN, failing of that is leading to failure of bluetooth connection.
How can I set/save the pair information so that it should not prompt pairing request every time I connect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到这个问题了。这可能是 Android ICS 问题。作为解决方法,您可以使用不安全套接字
I got this problem as well. This is probably Android ICS issue. As a workaround you can use Insecure Socket
您可以转到 Android 设置菜单上的蓝牙设置并永久配对设备!你以前尝试过这个吗?
You can go to Bluetooth settings on the Android settings menu and permanently pair the device! Have you tried this before?