Offline chat storage using sqlite

I have created a chat application using firebase, I want to save the chat data in the user's device and show it to the user if internet is not available. I'm torn between how to implement it, I wanted to use scope, but it increases my app size by almost 6mb (my app size is 4MB), so I switched to SQLite.

Now I want to know what would be the best practice for this I have implemented several processes, it is not clear yet how to do this.

I created a table master_chat , which I have message_id

, to

, from

and thread_id

and secondary table chat_data strong>, which I used message_id

as a reference to a table master_chat and pasted messageBody

, toEmail

, fromEmail

, time

, messageType

, fileSize

,downloadLink

now the question is whether I should follow this method so that each user enters a message which will be added to the chat_data, or will store an arrayList immediately and update it every time a message is sent or received.

any guidance would be great!

+3


source to share





All Articles