How to keep a XMPP connection stable on Android with (a)smack?

When using asmack put some code like this in your app to make Dalvik load the ReconnectionManager class and run it’s static initialization block:

static {
    try {
        Class.forName("org.jivesoftware.smack.ReconnectionManager");
    } catch (ClassNotFoundException ex) {
        // problem loading reconnection manager
    }
}

Leave a Comment