[Interest] QNetworkConfigurationManager::isOnline always returns false on Android 11

ekke ekke at ekkes-corner.org
Mon Sep 28 09:49:49 CEST 2020


Am 27.09.20 um 21:07 schrieb Thiago Macieira:
> On Saturday, 26 September 2020 10:29:28 PDT ekke wrote:
>> If I'm following your suggestion trying to connect - what should I do if
>> I cannot connect ?
> The same thing that you'd do if your watch classes told you were not online.
> And the same thing you're doing right now if you think you're online and can't
> connect, you must have a strategy for that too.
>
yep - here's my emergency strategy, if device isOnline but server cannot 
be reached:

I wait 2 minutes and try again

if server still not reachable, repeat this max 5 times to avoid 
endless-trying-to-connect

if still no success, I pause the Queue

User gets message and has to restart the Queue manually

message tells User to check if the server is OK (perhaps call the 
admin), to check if device is really online, trying to switch wifi 
on/off or to check if mobile network is active without allowing data 
transfer...

--

there are some thousand users out there in the wild working the whole 
day with my Qt 5.13.2 - apps relying on QNCM online state on Android (on 
iOS using iOS Reachability Classes. Starting w Qt 5.14 QNAM internally 
is using the Reachability Classes itself, so probably I can remove this 
platform-specific code 
https://bugreports.qt.io/browse/QTBUG-49751?focusedCommentId=475019&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-475019).

it happens only very very less times that a server is not reachable or 
online state is reported wrong

I don't want to use a timer and try to connect every x minutes to see if 
the user is online again - this will also dry the battery. The mobile OS 
already is watching this state so it would be great to get this SIGNAL 
from Qt on all platforms. BTW: next weeks I'll move all my apps to Qt 
5.15.1 to prepare them for Qt 6.



More information about the Interest mailing list