created my own ping stanza
private Stanza heartBeat = new Stanza() {
@Override
public CharSequence toXML() {
return “pinger”;
}
};
I created connection
xmpptcpConnection.connect();
if connected then
and sthen started sending the pingers- heartbeat
xmpptcpConnection.login(“user”,“pass”);
continue to send the whitespace / pings
( do not stop the phone Wifi or mobile data ) make sure u are connected but server is not reachbled ( i do this usiing the running the program on Andoeid eemualter and stoping my laptop wifi)
this makes think app u have internet but actually u are connected.
in above scenario SMack does not disconnect .