i’m currently trying to use smacks pub/sub system to implement some services for Android.
Basic login, roster, subscribe works great, but updates are currently distributed as stanzas. Now the fun begins.
Unless I’ve missread the PacketReader the logic is hardcoded. Even worse it’s burried in a private method stack, highly interacting with other private methods.
The only options seem to be (1) port the IQ logic or (w) fork the whole XMPPConnection/PacketReader monster.
So here is my question: How did you solve it? Is there something I’ve overseen?
All communication except wavelet updates are sent via PubSub (, “XMPP Publish Suscribe,” September 2008.) [XEP0060] events. Wavelet updates are sent using Message stanzas.
I guess the easiest way would be to merge iq and message parsing into one component that is told about the context (“message” or “iq”) and handles both…
What is it that you are trying to do exactly? The specification for XEP-0060 specifies message stanzas for item notifications (although it looks like it will support IQ packets for this purpose as well in the near future), so that part isn’t really a Smack issue.
Typically applications just need to receive the events as they occur and react to them, obviously you are trying to do something different.
The src/ folder will be auto-populated with smack-trunk, apache/harmony code and some other stuff.
Afterwards it’s packed into build, patched and compiled for android. Smack-trunk has some nice features, but it heavily breaks android compatibility (SASL & DNS classes aren’t available in Android, same goes for introspection with bean properties). So it’s non-trivial to make it work on Android (at least if you don’t want to go GPL and copy the JSE code).
Login works nicely with googlemail.com, even though this requires just about all patches in the package (DNS/SRV loopup, custom SASL, presence parsing).
I’m now playing around with PubSubManager and message parsing…