General android settings for Android and general preferences

So, I just collected my data between my actions and recently started saving my data using general settings, but now I’m wondering if it will be easier on the phone if I save and load general settings between actions or if I connect my data between them and use General settings to save them when they close the application, is the best choice? My data that I use is simple data such as a few lines of ints and boolean data.

+4
source share
3 answers

If you use SharedPreferences anyway, because you need to keep the values ​​when the application is closed, just use SharedPreferences all the time.

However, to save space on the user's phone, use the package if you only need to exchange data between actions, and it can be canceled after the application is closed.

+6
source

Bundles are intended to be used primarily for transferring data between activities. If the data that you store in the settings form, for example, you are better off using sharedpreferences. If you store more data than multiple ints passwords and what you have, you should use a SQLite database.

+3
source

You can use the Bundle to communicate between actions, but if you have a large amount of data, I suggest using the settings. To save your data when the application is closed, use SharedPreferences or Implementation of DataBase .

Android Data Saving

+2
source

Source: https://habr.com/ru/post/1523440/


All Articles