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

ekke ekke at ekkes-corner.org
Sat Sep 26 19:29:28 CEST 2020


Am 26.09.20 um 18:15 schrieb Thiago Macieira:
> On Saturday, 26 September 2020 08:53:52 PDT ekke wrote:
>> Am 26.09.20 um 17:39 schrieb Thiago Macieira:
>>> On Friday, 25 September 2020 23:58:26 PDT Alexander Dyagilev wrote:
>>>> Hello,
>>>>
>>>> Tested with Qt 5.12.9. Any workarounds?
>>> Suggestion: stop trying to check and assume that you are online.
>> imagine a mobile app for outpatient services, where a nurse visits
>> patients and at each patient has to confirm services done and to send
>> vital values and so on...
>>
>> while on tour and visiting the patients the device sometimes is online,
>> sometimes offline
> Ok, stipulated.
>
>> all service items done are written to a queue. queue watches online
>> state and always when the device is online items waiting in the queue
>> are sent to server
> Ok.
>
>> in the evening when all work is done user can only log out if all work
>> is sent to server - if not online he/she gets an info "you're not online
>> - work items cannot be sent" ...
> No. You don't need to know if you're online for that. You need to get the
> confirmation from the server that the server received the data. That completes
> the information loop properly.
>
>> assuming that the device is online won't work in such kind of use-cases,
>> pulling also is no good idea
> Yes, it is. Just try to connect. If you're offline, then you can't. If you're
> online but there's another network problem, then you can't either.
>
> I don't know what you mean by pulling. Did you mean a push API? I don't see
> how that would be relevant.

I meant using a Timer and try again every x minutes to send data to server

in my current apps on iOS I'm using iOS Reachability Classes to wat5ch 
online state,

on Android I'm using QNCM online state changed signal to watch online state

this works very well

If I'm following your suggestion trying to connect - what should I do if 
I cannot connect ?

start a Timer and try again ?

of course it'e easier to watch online state signal

>
>> (have some more mobile apps where it's also important always to know the
>> online state)
> You're online. That's what Qt 6 will tell you.

sounds good

ekke



More information about the Interest mailing list