Is there any limit for shared preference, instead of sqlite,can I save in preference?
I saw in the documentation that max length is 8192, that is preference elements size?
public static final int MAX_VALUE_LENGTH -
Maximum size in characters allowed for a preferences value.
Constant Value: 8192 (0x00002000)
The size mentioned in the docs is the “maximum no of characters a value can have”. Not the number of elements you can store.
Although there is no inherent limit to the number of items you can store – Retrieval and storage become very costly as the number of items increase.
SharedPreferences are meant to be used for global constants you might require throughout your app and not as a database replacement.
You cannot perform data manipulation and other SQLite operations on it.
So when the data is significant, Always go for a database.