简体   繁体   中英

Best way to store non-sensitive data in android?

In my android app, I download a huge json string, and want to store it for offline use. Currently I am using shared preferences to store it. But I am thinking now it may not be the best way to store a large string.

Also the data doesn't have to be encrypted. It can be stored in plain text, so security is not a problem.

Does anyone know if there's a better way?

You have other options, such as:

Internal Storage, External Storage, SQLite database.

For more information check http://developer.android.com/guide/topics/data/data-storage.html

SharedPreferences is a good option. It doesnt make any sense to store it in a file, SharedPreferences already does the same thing. I wouldnt suggest SQLite either because its just a string which still will be saved into a file. If the strings gets too big then i would suggest to have a method on splitting it into smaller objects then using SQLite for storing.

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