I know this question is old, but it describes my own problem. Differences:
I’m using 3.1.0 (asmack)
sometimes the callback is fired, and sometimes not (but most of the times not)
I know, that smack sends some sort of ping to server, but even if I wait for 15 minutes the callback is not fired, so that’s not the case of intervals (beside, I manually set it to 1 second).
Smack only sends a whitespace ping to the server, which is in most cases not sufficient to recognize a connection interruption in mobile environments. The result is that the ConnectionListeners often won’t be called.
I have development XEP-199 support fo Smack with a periodic ping thread. The current code is within the GTaklSMS repository, but I plan to move it to smack and aSmack in the next few weeks (see SMACK-388). Until then you can simply copy the files from GTalkSMS and report any issues you may encounter.
But note that XEP-199 is not the silver bullet on Android. I recommend to also listen for CONNECTIVITY_CHANGE intents and take the according actions.