Difference between shared preference and sqlite

前端 未结 6 569
闹比i
闹比i 2020-12-06 01:59

I know this topic has been discussed before on Stack Overflow. But there are still some things that are not clear when I read previous posts about it. So here they are:

6条回答
  •  半阙折子戏
    2020-12-06 02:51

    SharedPreferences is used for just that, storing user preferences shared application-wide. You can use it, for example, to store a user's username, or perhaps some options he or she has configured in your app in which you want to remember.

    SQLite is a relational database. It's used to store your application's data, not preferences or configuration information.

    Both are stored locally on the device.

提交回复
热议问题