I am using aSmack library for creating Group Chat ( MultiUserChat) in android. able to create MultiUserChat instance, getting available rooms in that domain and able to join in a perticular room. Now i have some question on this, those are
- Is it required to maintain same instance for MUC in throughout application ?
- How to get last 20 discussion history of a particular room ?
now i try like this to get discussion history
DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(20);
muc2.join(acc_id, null, history, JOIN_TIMEOUT);
Message oldMsg = muc2.nextMessage(1000);
By using above code now i am getting only one message from server that is also first message available in the history. But my requirement is i want to get all the last 20 messages available in the discussion history of a room.
Anybody help me on this issue's...