Anshul Bhatheja
Anshul Bhatheja

Reputation: 693

How to Export/Import Data from the local database?

I am working on an iOS and Android app which uses a local database for saving the data. Now my client wants to add the export & import data option in the app. So that the user can export data from one device and import it on any other device to use his account as it is. How can I do that? Any references or help.

Thanks In Advance!!!

Upvotes: 2

Views: 877

Answers (2)

Nima Mohammadi
Nima Mohammadi

Reputation: 363

The best way to do that is creating a way to read data and write data to a .csv file. In reading you can easily write your data like a text file and separate every entry with ','. and reading data from it is also easy , you can read file line by line and use java string tools to process the string file and fetch data from it.

Beside it can be edited or generated by Microsoft excel. So the client could easily work with it.

Upvotes: 0

Jaime Suarez
Jaime Suarez

Reputation: 660

You can try to export all the data from the database to a .csv file and read from iOS or viceversa.

You can find an example of how to export data in Android here

Upvotes: 1

Related Questions