Reputation: 399
I am using Socket.io for sends and receives messages. I want to store the Chatting history among the users.
What is the best possible way to maintain the chat history and any snippets will be of great help.
Upvotes: -1
Views: 880
Reputation: 5068
You can either write to a file and load from their when required. Or the other way around would be to use SQLite database to store the messages on the individual device.
Upvotes: 0
Reputation: 8464
You can store it in local database link SQLite or Android Room.
You can follow this reference link for integrating Android Room : https://developer.android.com/topic/libraries/architecture/adding-components.html
Use this reference link for SQLite : https://developer.android.com/training/data-storage/sqlite.html
Thanks.
Upvotes: 0