Here network connectivity changes means switching
from wi-fi to mobile data and vice-versa. And also switching on
and off internet connection on Android platform.
The issue is on Android when I disable internet
connection (mobile data) connectionLost callback does not
gets called even after KeepAliveTimeInterval has elapsed. And
does not receive any further published message (after internet
connection is back on) making the connection useless. That's
why whenever network connectivity changes I want to make sure
that the connection is working properly with a forced ping.
What I just observered is connectionLost does not
gets called org.eclipse.paho.client.mqttv3-1.0.0 but it works
fine on org.eclipse.paho.client.mqttv3-1.0.1-SNAPSHOT. Even
though it is working fine on later version I need explicit
ping as I don't want to keep ping interval to low value as it
would consume battery on mobile and I can even afford to wait
till next scheduled ping.