android - 无需配对的蓝牙连接

标签 android bluetooth connection

我一直在寻找一种方法来使用蓝牙连接两部手机,而无需先将它们配对。我试图忽略烦人的蓝牙弹出请求。谷歌商店中有一个名为 Bluehood 的应用程序可以执行此操作。我想将这种连接方式用于我在完全不同的利基市场中构建的应用程序。您可以在谷歌商店中搜索名为“Bluehood Social Bluetooth”的应用程序。 https://play.google.com/store/apps/details?id=com.mobile.bluehood

最佳答案

您可能会在两个设备之间创建不安全的蓝牙串行连接。

创建连接:

识别 BluetoothDevice 并调用其方法 createInsecureRfcommSocketToServiceRecord

接收连接:

获取 BluetoothAdapter 并调用方法 listenUsingInsecureRfcommWithServiceRecord

此技术不需要设备使用配对代码建立连接。它在 API 级别 10 及更高版本中可用。

关于android - 无需配对的蓝牙连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23945171/

相关文章:

php - 使用 .htaccess 和 Android 应用程序连接到 php 页面

java - 你如何在Java中顺序播放音频文件?

android - 拦截后退按钮

android - 更改 InputType 后重绘 EditText

android - 这两种方法在volley中有什么用呢?

android - ios和android之间的快速直接通信

iOS - 在后台监听应用程序的网络连接变化

iphone - EASession、EAAccessoryDe​​legate 和 "ERROR - opening session failed"

android - 通过蓝牙连接安卓手机和笔记本电脑

java - 如何在花费几秒钟后忽略 if 语句