在 Android 中激活蓝牙 SPP?
我正在尝试使用蓝牙 SPP 通过它进行通信。在某些 Android 手机中,SPP 配置文件未激活。我在应用程序中遇到了 SPP 未激活的问题,因此无法通过蓝牙建立连接,当我启动另一个 3g 热点应用程序时,我认为它激活了 SPP,并且我能够在我的应用程序中通过蓝牙进行连接。
那么,我们如何才能在Android设备中真正激活蓝牙的SPP配置文件呢?所有的 Android 设备都有 SPP 配置文件吗?
I am trying to use Bluetooth SPP to communicate over it. In some Android phones, SPP profile is not activated. I faced the problem in the application that SPP was not activated and so the connection could not be established over bluetooth and when I started another app that is 3g hotspot which I think activates SPP and I was able to connect over bluetooth in my app.
So, how can we actually activate SPP profile of bluetooth in Android devices? And does all the android devices has SPP profile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在developer.android.com BluetoothSocket:
In developer.android.com BluetoothSocket:
这可能会回答你的问题..
https://source.android.com/devices/bluetooth/services
SPP(或Android (2.0/2.1) 版本 (Eclair) 及以后版本提供了使用 Java API 建立 RFCOMM 通道的功能。
在 Android 手机上,您可能需要运行一个通过 SPP 启动服务的应用程序。
**
** API可用于创建指定UUID的服务来监听,
这样做应该使该服务对其他可以连接到它的设备可见。
This might answer your question ..
https://source.android.com/devices/bluetooth/services
SPP (or ability to use Java API's to establish RFCOMM channels) is available from Android (2.0/2.1) release (Eclair) onwards
On the Android phone you will probably need to run an application that initiates the service over SPP.
**
** API can be used to create a service with specified UUID to listen,
Doing this should make this service visible to other devices which can then connect to it.
我刚刚致电三星寻求帮助,询问 S8+ 手机上的蓝牙 SPP。他们告诉我等待 Android Oreo,因为到那时它才可用。我以前的索尼 Xperia 使用 Ntrip 客户端与外部 Geneq GPS 通信以接收校正后的坐标,效果非常好。好像我们在某个地方倒退了?
手机上的 Ntrip 客户端每五秒收集一次 GPS 校正的互联网数据流,并将这些数据发送到 GPS。 GPS 使用校正并将调整后的坐标发送回手机以在任何应用程序中使用。
我很感激有人比我更聪明,指出一个快速修复,我只需加载并运行即可恢复此功能。
I just called Samsung help regarding bluetooth SPP on an S8+ phone. They tell me wait for Android Oreo as it isn't available till then. My previous Sony Xperia used Ntrip Client to talk to an external Geneq GPS to receive corrected coordinates and worked really well. Seems we went backwards somewhere?
Ntrip client on the phone collects an internet data stream of GPS corrections every five seconds and sends these to the GPS. The GPS uses the corrections and sends back adjusted coordinates to the phone to use in any application.
I would appreciate someone brighter than me pointing out a quick fix I just load and run to bring back this functionality.