如何在Android编程中使用蓝牙发送和接收数据而无需配对?
我是 Android 编程新手,并且有 java 概念,我想知道如何使用蓝牙发送和接收数据而无需配对或任何密码(仅当两个设备都安装了我的应用程序时), 有什么建议吗?
I am new to Android programming, and have java concept, I want to know that how can I send and receive data using bluetooth without pairing or any password (Only if both device has my app installed),
any suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,在没有配对的情况下不可能通过 RFCOMM 套接字发送或接收数据。我已经在我正在开发的应用程序中进行了广泛的尝试。我的结果是:
正如 @ethrbunny 提到的,您也可以只使用 WiFi,在每个设备上设置并行服务器/客户端线程,然后发送您想要的任何内容。要发现本地网络上的服务,您可以选择使用 Zeroconf。
As far as I know it's impossible to send or receive data over RFCOMM sockets without pairing. I've tried this extensively with an application that I'm developing. My results are:
As @ethrbunny mentioned you can also just use WiFi, setup parallel server/client threads on each device, and send whatever you want. To discover services on a local network you can optionally use zeroconf.
我从 Kristopher Micinski 发布的 Google 群组帖子。
希望有帮助。
I got the the following from this Google groups post by Kristopher Micinski.
Hope it helps.