powered by Jive Software

Reagrding Custom Packet


I want to write a custom IQ packet in smack API.

I am unable to find any sample code related to that .

Any starting pointers will be highly appreciated.




Take a look at the DiscoverInfo code in the Smack source. Your new class needs to extend the IQ class and implement the getChildElementXML() method. This method must return a valid chunk of namespaced XML. You also need to write an IQProvider class that handles the parsing of the namespaced XML that makes up your new IQ class. You new IQProvider class must be registered with the ProviderManager class by calling ProviderManager.addIQProvider(elementName, namespace).