I am moving my android application from asmack-android library to Smack 4.1.4. I have some PacketExtensions in the asmack version of Smack, which uses PacketExtension and PacketExtensionProvider classes to handle. Since the PacketExtension is deprecated in Smack 4.1.4, I am confused among the classes and interfaces ExtensionElement, DataPacketExtension, ExtensionElementProvider , DefaultExtensionElement. Could any one of you give me an example of creating an extension which can be added with stanza and parse back...https://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware /smack/packet/DefaultExtensionElement.htmlhttps://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware /smack/provider/ExtensionElementProvider.html
相关问题
- Unable to get all user in asmack
- GCM using smack library NoResponseException: No re
- smack api get all public rooms on openfire server
- SSL handshake hang
- How to Integrate FCM with Ejabberd?
相关文章
- Sending inline images using Smack XMPP
- XMPP events on Android
- How to create an account from Smack 4.1
- getting “XMPPException$XMPPErrorException: XMPPErr
- read incoming Message packets in pubsub using smac
- how to create persistent muc room in smack 4.1 bet
- How to use smack with Openfire
- difference between XMPP servername and XMPP servic
Finally figured it out.... Here is the solution for it...
Provider for the above extension is as follows...
And should be added in Provider manager as following....
This will produce the following stanza
1. CUSTOM EXTENSION STANZA TYPE-1
In order to generate below custom extension stanza
where reply is a custom extension, which contains
the list of default xmpp namespaces are available at Official XMPP website
Do following steps
1. Add ReplyExtension.java in your project
ReplyExtension.java
2. Register ReplyExtension in your Provider Manager
FOR SENDING MESSAGES
You can generate the custom extension stanza TYPE-1 by using following code
DURING RECEIVING MESSAGES
Now during receiving custom extension stanzas, you need to cast the extension to get attribute values.
_______________________________________________________
2. CUSTOM EXTENSION STANZA TYPE-2
In order to generate below custom extension stanza
FOR SENDING MESSAGES
You can generate the custom extension stanza TYPE-2 by using following code
DURING RECEIVING MESSAGES