Posts Tagged Android SharedPreferences

Storing Objects in Android

One alternative to using SQLite on Android is to store Java objects in SharedPreferences. Here, we’ll look at two different ways to do that. Why not go for SQLite for all storage needs? The reasons can be varied: besides the impedance mismatch between object orientation and relational databases, SQLite might be overkill (brings more overhead) […]

, , , , , , , , ,


Android Persistence: SharedPreferences

Android provides a number of options for persisting data, from using SQLite databases to internal or external storage on the SD card. ¬†For primitive types¬†however, there is a much simpler technique for saving data between user sessions called SharedPreferences, which provides persistent key-value pairs of primitive data types. A priori, we might think that, by […]


1 Comment