title: How to keep a XMPP connection stable on Android with (a)smack?
body: <p>I use asmack-android-7-beem library for Android. I have a background service running, such as my app stays alive. But sooner or later XMPP connection dies without any notice. The server says that the client is still online but no packets are sent or received.</p>
  
  <p>For example the client doesn't receive any presence packets when other clients have a new presence. I have XMPPConnection as an attibute of my main Application class.<br>
  I set <code>ConnectionConfiguration config.setReconnectionAllowed(true)</code> before the connection was made.<br>
  But reconnection doesn't happen. <code>XMPPConnection connection.isConnected()</code> returns true.</p>
  
  <p>So the client is not aware that connection is actually lost. </p>
  
  <p>Is there any way to keep the connection alive?</p>