How to retrieve Chat history with android smack client


I’m developing a chatting application where we have deployed the eJabberd on server and using smack library client for my android.

Now the problem is i was not able to get the previous chat history to show. Please help me out in getting the chat history.