I\'m a newbie to XMPP so forgive me if this question sounds silly. I want to create a custom plugin and map it with my aSmack client on Android. I\'m trying to apply my kno
This is a sample of plugin implementation:
First, you should implement the Plugin interface:
public class MotDPlugin implements Plugin
Then, this requires implementation of the intitalizePlugin and destroyPlugin methods, as shown below:
public void initializePlugin(PluginManager manager, File pluginDirectory) {
serverAddress = new JID(XMPPServer.getInstance().getServerInfo().getName());
router = XMPPServer.getInstance().getMessageRouter();
SessionEventDispatcher.addListener(listener);
}
public void destroyPlugin() {
SessionEventDispatcher.removeListener(listener);
listener = null;
serverAddress = null;
router = null;
}
The more about this sample, you may refer to the Openfire Plugin Development: Message of the Day.
Hope it helps.