[Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11
ekke
ekke at ekkes-corner.org
Sat Sep 26 19:37:22 CEST 2020
Am 26.09.20 um 18:46 schrieb Marian Beermann:
> An interface like this is inherently racy. QNCM (obsolete) may tell you
> you are online, you connect to the server, send your stuff, and while
> that happens the device goes offline and you get an error. You probably
> handle this case already.
yes - I'm handling this and other kinds of error from server
if getting some specific errors, queue will be paused and user get's a
message
>
> Stuff like this is "informational" and you can't assume stuff will work,
> because the API said you're online. Conversely, your servers might be
> reachable even if it says the device is "offline". (What does "internet
> connectivity" mean, after all? It's pretty hard to define...)
>
> I second Thiago's suggestion - just keep trying quietly in the
> background, don't rely on "device is online" indicators (either in Qt,
> or in other frameworks/APIs).
I think it will use more battery always trying to send data to server
instead of waiting for a signal from the underlying OS
>
> If you only have a "heavy" API endpoint to use, I'd ask the backend
> developers to add a lightweight "status" API endpoint you can use to
> check if you can reach the server without necessarily doing any hard work.
there's a ping api - so I could try this before sending heavy data
(the size of data to be sent is different - sometimes only some bytes,
sometimes an image (wound image per ex))
ekke
More information about the Interest
mailing list