【发布时间】:2014-08-16 13:24:18
【问题描述】:
我们应该在哪里插入setPin(String pin) 来配对蓝牙设备?函数应该在createBond之前还是之后调用??
在这篇文章中的回答 Howt to connect two devices via bluetooth sending the pairng code by parameter? JAVA-Android 表示应该在调用 createBond() 之前调用它
但是问题How can I avoid or dismiss Android's Bluetooth pairing notification when I am doing programmatic pairing? 告诉了完成蓝牙配对的步骤,其中setPin 在createBond() 之后被调用。如果这可行,那么它应该在 BroadcastReceiver 中调用,我们会在其中获取配对请求的回调。
哪种方法是正确的?我真的很困惑!
【问题讨论】:
标签: java android bluetooth android-bluetooth