Tag Archives: sharedpreferences


How to get all values of SharedPreferences programmatically in Android

SharedPreferences stores all values in XML file. So, if you want to iterate through all the values stored in it, you could try following code.

Continue reading


Store Data – SharedPreferences – Android

When it comes to store data like

  • username for a user specific application, or
  • checking how many times the application is opened.

It is not a good choice to manage a database. As mentioned in previous blog posts, Android SQLite Database – Part 1, and Android SQLite Database – Part 2, it will be time consuming. In conjunction to that, it is not going to fulfill why database is for and database transactions are costly for such one time transaction. So, it is good if you choose to save data, like in above example, in SharedPreferences.

Continue reading