是有可能有蓝牙配对/连接而无需用户交互?

问题描述:

是否有可能在Android的(我感兴趣的是Android 4.0及更高版本)有没有用户交互的完整的粘合/配对过程还是不能禁用安全功能?

Is it possible in Android (I'm interested in Android 4.0 and later) to have a complete bonding/pairing process without user interaction or is it a security feature that cannot be disabled?

我看到开始粘合的唯一方法/配对使用 BluetoothDevice.createBond()

The only way I see to start bonding/pairing is by using BluetoothDevice.createBond()

和它的文档是不是找看好我:

And it's documentation is not looking promising for me:

启动与远程设备的接合(配对)处理

Start the bonding (pairing) process with the remote device.

这是一个异步调用,它会立即返回。注册ACTION_BOND_STATE_CHANGED意图的结合过程完成时得到通知,而且​​它的结果。

This is an asynchronous call, it will return immediately. Register for ACTION_BOND_STATE_CHANGED intents to be notified when the bonding process completes, and its result.

Android系统服务将处理必要的用户交互确认并完成>键合工艺。

Android system services will handle the necessary user interactions to confirm and complete the >bonding process.

需要BLUETOOTH_ADMIN。

Requires BLUETOOTH_ADMIN.

有另一种方式?或者,也许一些设置/配置,我可以改变?

Is there another way? Or maybe some settings/configurations that I can change?

如果你只是想与蓝牙设备进行通信。您可以选择禁用配对安全功能。

If you just want to communicate with a bluetooth device. You can choose to "disable" the pairing "security feature".

使用BluetoothDevice.createRfcommSocketToServiceRecord,是需要对/债券过程,该过程将在需要时被触发,因为你正在尝试创建一个RFCOMM的BluetoothSocket准备开始的安全传出连接使用UUID的SDP查找该远程设备。(从Android的API文档)

With "BluetoothDevice.createRfcommSocketToServiceRecord", the pair/bond process is needed and the process will be triggered if needed, because you are trying to "Create an RFCOMM BluetoothSocket ready to start a secure outgoing connection to this remote device using SDP lookup of uuid."(which from android API Doc)

使用BluetoothDevice.createInsecureRfcommSocketToServiceRecord,不需要对/债券的过程。

With "BluetoothDevice.createInsecureRfcommSocketToServiceRecord", the pair/bond process is not needed.

所以,如果你的沟通信息是保密的,你需要的债券的过程。如果你的沟通不是保密的,不安全的插座也许你想要什么。

So, if your communication message is confidential, you need the bond process. If your communication not confidential, insecure socket maybe what you want.