android
android copied to clipboard
Network Changed Events
The android docs say:
The app cannot attempt to connect if the network connection changes because it is not possible to receive the network change event.
And so has it been posted a couple of times in this bugtacker. Now I'm not an android dev, so I might just be wrong, but from browsing the android developer reference, I don't think this is true. I looked at:
This brought me to: NetworkInfo where they indeed talk about some deprecation in API level 28 and I assume this is what was meant by not being able to detect the netowrk state event, however there is also an alternative given:
And if I understand this correctly, you can register you own callback functions, that get called on network events.
This also ties in with resetting the sendmessage queue wait timeout on config change as well as network change.