Reputation: 69
I just want to ask if it is good practice to save large array lists (of custom objects) in the Shared preferences using Gson.
By large I mean that the list might contain up to 500 object.
Upvotes: 2
Views: 1135
Reputation: 1795
As you can read in android reference docs: https://developer.android.com/training/data-storage/shared-preferences.html
If you have a relatively small collection of key-values that you'd like to save, you should use the SharedPreferences APIs.
Else if you have a large amount of data the best solution is to use file storage or sqlite or anything else.
Shared preference is made for store private primitive data types: booleans, floats, ints, longs, and strings, not arrays or complex objects.
Upvotes: 3