-1

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.

Jitendra Singh
  • 399
  • 4
  • 14

2 Answers2

0

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.

Sagar Kacha
  • 8,338
  • 4
  • 18
  • 27
0

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.

Waqar Ahmed
  • 5,005
  • 2
  • 23
  • 45