Search code examples
javaandroidsharedpreferences

Is SharedPreferences necessary for all data?


I am new in Android.

I have a database like this.

enter image description here

I used SharedPreferences for remember user information.

However, there is a point that I do not understand. When the user logins the application, do I need to save all Firebase data in SharedPreference for the application to remember the user?

Which type of datas save in SharedPreference? I just want, If a user logins the application, my application will remember the user and its checkboxes, comments, likes or something else.

It might be a stupid question, but I am new in this. Thank you for all.


Solution

  • Yes you can use sharedPreferences for this purpose. You can save int, String, boolean, float, double... in sharedPreferences.

    You need to save user information in sharedPreferences on login.