For the first beta of Smack, IQ support is pretty limited. Basically, Authentication is the only fully-realized IQ packet class.
The plan is to support registration and all roster operations via higher-level classes (with the idea that you generally shouldn’‘t need to code at the packet level). So, there will be a AccountManager and a Roster class. We’'ll probably also add a GenericIQ class to facilitate creating arbitrary IQ packets.
For now, you could create your own IQ packets with code like the following:
// Create an anonymous inner-class. You could also
// create a full-fledged class instead.
IQ registerIQ = new IQ () {
public String getQueryXML() {
return "<query xmlns=''jabber:iq:roster''>" +
"<item jid=''contact@host'' name=''contact''/> " +
"</query>";
} };
registerIQ.setType(IQ.Type.SET);
Obviously, this isn’'t ideal, but a cleaner solution will have to wait for an upcoming beta.