Reputation: 13
I have developed an app that is to save daily income and outcome. Those income and outcome will be update every time. If my phone is break down, my app's data will be lost? How should I do to save income and output record.
Upvotes: 0
Views: 95
Reputation: 311
If you have a external storage on your phone, such as an SD card, you could save your data to a SQLite database located here, so you're not losing you data even if you do a factory reset. Most devices won't never delete your SD Card data during a factory reset, some other may ask you if you want to.
Any information android would by default keep in the data folder, except non critical stuff (remembering user's login, personal settings...) should be saved in the external directory.
To write to the external storage, you must request the WRITE_EXTERNAL_STORAGE permission in your Manifest, and while creating the database, call an overloaded method that allows you to specify its location.
Upvotes: 1
Reputation: 10037
Or save data (encrypted text or other file) in memory card.
Or use sqlite technology.
Upvotes: 0