简体   繁体   中英

To save app data in android

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.

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.

  1. Upload (Post by using php) details to website database by using json api.
  2. Or save data (encrypted text or other file) in memory card.

  3. Or use sqlite technology.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM