当应用程序不在前台时如何使用 rxandroidble 自动连接到 BLE 设备?

How to autoconnect to a BLE device when app is not in foreground using rxandroidble?

根据文档:

Unlike the native Android API, if autoConnect=true while using this library there will be NO attempts to automatically reconnect if the original connection is lost.

我希望 phone/app 在回到范围内时能够连接,即使在发生这种情况时该应用程序未被使用,我并不真正关心该应用程序,只需要 phone待连接。

如果我没记错的话,即使应用不是 运行,只要设备是 paired/bonded,本机 API 就会触发重新连接(这个假设是否正确?).

我如何使用 RxAndroidBle 实现此目的? 运行 带有烦人的粘性通知的前台服务是唯一的方法吗?

If I'm not mistaken, the native API would trigger a reconnection even if the app is not running as long as the devices are paired/bonded (is that assumption correct?).

这个假设是不正确的。您仍然需要启动连接的进程。

How could I achieve this using RxAndroidBle? Is running a foreground service with an annoying sticky notification the only way?

您已经回答了您的问题 — 使用本机 API(实际上由 RxAndroidBle 在幕后使用)时,同样的说法也是正确的)