Android 4.4 BLE扫描缺乏稳定性 [英] Android 4.4 BLE Scanning lack of stability

查看:116
本文介绍了Android 4.4 BLE扫描缺乏稳定性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Bluetooth LE Jedi是否知道如何在廉价的Android 4.4设备上获得可靠的BLE扫描模式的技巧?

Would a Bluetooth LE Jedi know any trick how to get a reliable BLE scanning mode on cheap Android 4.4 devices ?

从Android 5到6,一切正常,大多数Android 4.4手机...
但是,在一些价格便宜的4.4手机上,我们会遇到随机问题,根据环境,白天,天气等原因,有些电话无法检测到任何东西,有时甚至只能检测到一些信标...显然是由于这方面的软件或硬件较差,但是使其在程序上更稳定的技巧(例如定期启用/禁用蓝牙)

Everything works fine from Android 5 to 6, and most of the Android 4.4 phones... However, on some cheap phones with 4.4 we encounter random issues, some phones do not detect anything, or sometimes just a few beacons among others, depending on environment, daytime, weather, or whatever... It's obviously due to a poor software or hardware on this side, but is there any trick to make it more stable programmatically ? (for example enabling / disabling Bluetooth regularly)

EDIT

要描述一种典型行为:

首先,请注意,对于我可以测试的所有扫描应用程序,行为都是完全相同的(Estimote, Kontakt.io,AltBeacon等)-因此,这很可能与应用程序实现无关。

First, note that it is the exact same behavior with all scanning Apps I could test (Estimote, Kontakt.io, AltBeacon, etc. etc.) - so this is much probably not a matter of App implementation.

它仅在Android 5(4.4.2, 4.4.3、4.4.4)和便宜的设备上,例如三星S5等手机上绝对不能。

It occurs only below Android 5 (4.4.2, 4.4.3, 4.4.4) and on cheap devices, never on phones like a Samsung S5 for example.

行为:让我们假设有5个信标非常接近(小于2米,都可以正常工作)。
-重新启动后,手机会在1或2分钟内找到5个信标。
-然后在5分钟内什么都没找到。
-刷新后会找到2个信标。
-扫描的另一次刷新:仅找到1个。然后什么也没有...等等。

The behavior: let's assume we have 5 beacons very close (less than 2 meters, all working fine). - Once rebooted the phone finds 5 beacons for 1 or 2 minutes. - Then it finds nothing for 5 minutes. - After a refresh it finds 2 beacons. - Another refresh of the scan: only 1 found. Then none... etc.

我找不到任何逻辑,现在看来很不稳定。
启用/禁用Wifi /蓝牙,Bluetooth + Wifi,Wifi然后是Bluetooth等,有时使扫描找到更多信标,有时却没有...如果我只是等待而不更改这些参数,则可能没有太大区别。

I could not find any logic, for now it looks erratic. Enabling / disabling Wifi / Bluetooth, Bluetooth+Wifi, Wifi then Bluetooth, etc. make sometimes the scan find one more beacon, sometimes not... there is probably not much difference if I just wait without changing those params.

恢复可靠扫描的唯一方法是重新启动设备...然后它只能再次工作1或2分钟...

The only way to get back a reliable scan is to reboot the device... then it works only for 1 or 2 minutes again...

它发生在一些非常不同的设备上(例如Wiko Sunset,Samsung XCover和Orange Roya)。

It occurs on some very different devices (a Wiko Sunset, a Samsung XCover, an Orange Roya).

在更新的设备上(Nexus 6,Samsung S5,Samsung A4 ...),可以检测到100%的信标,持续数小时,并且永不丢失。

On more recent devices (Nexus 6, Samsung S5, Samsung A4...), 100% of the beacons are detected, for hours, and never lost.

因此,重新启动后,实际上是检测到所有信标的最佳解决方案,我想知道是否有一种方法可以刷新设备的蓝牙模块,而无需重新启动它...或者我们是否必须成为对此的哲学家;-)

So, as the complete reboot is actually the best solution to get all beacons detected I was wondering if there is a way to "refresh" the device's Bluetooth module without rebooting it... Or if we just have to become a philosopher about this ;-)

推荐答案

如果您使用node.js开发应用程序,那么有很多api可能对您有用。但是在android的情况下完全取决于您的Android版本

if you are develop your application using node.js then there are many api's avaliable which may work for you.But in case of android it is totally depend on your android version

这篇关于Android 4.4 BLE扫描缺乏稳定性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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