Smack Chat History

Hey everyone,

I’ve been developing my chat application for android and I noticed that I was not able to retrieve past conversations I had with someone. Every time I started a new conversation I would start from a blank page. I have not found any solution online on how to retrieve past chats, or past messages. What would be the best way to create a method so that the user on the phone would be able to see his past conversations with someone he has already spoke too (similar to scrolling up on Whatsapp/iMessage/Android Messanger). Would I have to create a plugin, or connect a database to Openfire? Thoughts, suggestions?