Using Smack 4.1.3
Code is here: https://gist.github.com/blacklightknight/8894b20cf68c3a288b91809b77f0ba2a
Stacktrace in the same gist as well.
My Question ->
I am trying to send a custom iq to ejabberd server (I was successful in that) and then perform some custom operations on the server (also done) and then send a response from server to android client with custom parameters/attributes(Also done, but after getting this result in android is where I am stuck). Example:
I am sending this iq
SENT (1): <iq to='example.com' id='D2IDi-16' type='get'><query xmlns='ns:custom'><a/></query></iq>
And I am getting this result
RECV (1): <iq email@example.com/Smack' from='example.com' type='result' id='D2IDi-16'><query xmlns='ns:custom'><response op='sum' val='4'/></query></iq><r xmlns='urn:xmpp:sm:3'/>
But I wanted this response in some variable or something on Android side for further computation but somehow I haven’t been able to achieve it.
I have searched for it a really long time now and I have found most of the example outdated, or should i say smack have grown from then.
To be specific my code gives compilation error at line
saying that "There is no default constructor available in ‘org.jivesoftware.smack.packet.IQ’ " where as in all the examples I have seen this line runs fine.
So what am I missing ? If this is wrong approach then how can I correct it?
Please help me out with some examples.