powered by Jive Software

Asmack android 4.0.2 Roster packets not received by the packet listener

I’m updating my IM application’s library from asmack-android-19-0.8.10 to asmack-android-8-4.0.2. I downloaded the jar files from this link. And my login code is as follows.

`ConnectionConfiguration conConFig;

XMPPConnection localConnection = null;

SmackConfiguration.DEBUG_ENABLED = true;
SASLAuthentication.supportSASLMechanism(“PLAIN”, 0);

conConFig = new ConnectionConfiguration(IM_XMPP_Commons.HOST,
IM_XMPP_Commons.PORT);
conConFig.setCompressionEnabled(false);
conConFig.setRosterLoadedAtLogin(true);

conConFig.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
SmackAndroid.init(Application.getInstance().getContext());

localConnection = new XMPPTCPConnection(conConFig);
localConnection.connect();
localConnection.login(username, password);`

With my previous version whenever I logged in I was able to get the roster packets correctly. But After updating to this version I couldn’t. To solve that I gone through the org.jivesoftware.smackx/extensions.providers file. In which I didn’t find the RoterExchange extension. And also there is no package with the name of org.jivesoftware.smackx.xroster. So how should I listen for the packets with the extenstion “x”, “jabber:x:roster” ?

XEP-93 has been deprecated. The Roster Item Exchange code has been moved into the smack-legacy subproject which is not included in asmack. You could try adding the smack-legacy jar to your project classpath or just copy the relevant source files while configureing the providerManager manually, but there is no gurantee from my side that it will work on Android.

Thanks Flow.** **