I implement an IM app on Android use asmack library.
In code, I use a singleton object to manage the XMPPConnection instance, then I build the connection after main Activity launched.
But when I press the back button to exit my app, then I found my XMPP account be offline after some minutes.
How can I keep-alive the xmpp on background?