Search code examples
androidpreferences

What do I use preference or sqlite database for my application settings screen


Please excuse me if this is a very novice question, but I am little confused. I have a settings screen in my application, where there are check box or radio button option and spinner option. user has to select one and my application will be updated with the saved settings option. Now I believe I can do the same with sqlite database but looks like preferences is used for such kind of scenarios only. How good it will be to use preferences and not sqlite database. I am not sure which way I should head.

Please someone explain. Thanks in advance.


Solution

  • SharedPreferences is good for non-structured data. It's quite easy to use; with SQLiteDatabase you would end up writing quite a bit of code while never taking advantage of the core competencies of sqlite3, such as indexing, sorting and joins.