Description of the problem
I am creating an Android application based on the XMPP protocol. Smack is used as the XMPP client library. In applications, messages are stored in the SQLite database.
Question
How to implement message caching (for example, in Facebook messenger)? If 20 messages are loaded on the server and shown to the user, if it is not displayed from the local database. If the user scrolls the page again, check the database and server and display the next 20 messages.
Is open source available?
source share