Android的蓝牙连接丢失 [英] Android Bluetooth connection lost

查看:400
本文介绍了Android的蓝牙连接丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序正在检测配对的蓝牙设备。结果
如果它的发现,我的应用程序启动。结果
而当连接丢失,我的应用程序停止。结果
但连接每10,15秒丢失。

My application is detecting a paired Bluetooth device.
If it's found, my application starts.
And when the connection is lost, my application stops.
But the connection is lost every 10,15 seconds.

我该如何解决呢?

推荐答案

每当连接于一个硬件级封闭 ACTION_ACL_DISCONNECTED 发送。当发生这种情况是特定于设备本身。如果您手动断开/拔出其他设备,它在某种程度上不发送关闭的连接信号传送到机器人,长达20秒的一些监视运行后,而不是和关闭连接,意图发送。

ACTION_ACL_DISCONNECTED is sent whenever the connection was closed on a HARDWARE level. WHEN that happens is specific to the device itself. If you manually disconnect/plug out the other device, it somehow does not send a closed connection signal to the droid, instead after up to 20 seconds some watchdog runs and the connection is closed and the intent is sent.

由于这是特定于设备的硬件,去从另一个设备检查。

As this is specific to the device hardware, go for checking from another device.

这篇关于Android的蓝牙连接丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆