Hello friends
i am trying to get last seen seconds just like whats up show. here is my code to sent packets
Packet pk = new Packet(){
@Overridepublic String toXML(){// TODO Auto-generated method stubreturn"<iq from='myjid@host,com' id='last2' to='friendsjid@host.com' type='get'> <query xmlns='jabber:iq:last'/></iq>";}};
XmppActivity.connection.sendPacket(pk);
My Request is
11-15 15:56:34.805: D/SMACK(26753): 03:56:34 PM SENT (1109640912): <iq from='myjid@host.com' id='last2' to='friendjid@host.com' type='get'><query xmlns='jabber:iq:last'/></iq>
but if my friend is online, it always returns 0 seconds in the results
11-15 15:54:10.910: D/SMACK(26753): 03:54:10 PM RCV (1109640912): <iq type="result" id="last2" from="friendjid@host.com" to="myjid@host.com/Smack"><query xmlns="jabber:iq:last" seconds="0"/></iq>
but if my friend is offline, it always returns -1 seconds in the results
11-15 15:54:10.910: D/SMACK(26753): 03:54:10 PM RCV (1109640912): <iq type="result" id="last2" from="friendjid@host.com" to="myjid@host.com/Smack"><query xmlns="jabber:iq:last" seconds="-1"/></iq>
Please help me to fix this..
Thanks a lot