Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i store chat history in Android

Tags:

android

xmpp

I am working on an XMPP client app that sends and receives IM using ASmack library. I want to store the Chatting history among the users. This history must be persistent until i clear the chat by clicking a button.

What is the best possible way to maintain the chat history and any snippets will be of great help.

like image 529
Rahul Kalidindi Avatar asked May 06 '11 06:05

Rahul Kalidindi


People also ask

How do I save my chat history on Android?

You can use the export chat feature to export a copy of the chat history from an individual or group chat. Open the individual or group chat. Tap More options > More > Export chat. Choose whether to export with media or without media.

How can I recover deleted chat history in Android?

Launch LINE on your Android, go to its Settings > Chats, and select the feature to backup and restore chat history. Step 2. From here, tap on the option to backup your chats on Google Drive. Also, you can tap on the Google Account section to make sure that LINE is connected to an appropriate account.

How do I backup my WhatsApp chat history on Android?

Open WhatsApp. Tap More options > Settings > Chats > Chat backup > Back up to Google Drive. Select a backup frequency other than Never. Select the Google account you'd like to back up your chat history to.


1 Answers

A simple Sqlite database comes to mind. You could then save all history of all chats for as long as you need. And selectively erase one chat session and not another.

See : http://developer.android.com/guide/topics/data/data-storage.html#db

And you'll find a lot of easy tutorial to follow along on the interweb.

like image 104
Yahel Avatar answered Sep 28 '22 08:09

Yahel