Difference between shared preference and sqlite

前端 未结 6 551
闹比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:32

    1.SharedPreferences stores only Boolean, int, float, long, String five kinds of simple data types, such as can not be conditional query. So, whether SharedPreferences data storage operation is how simple it can only be a supplement of storage, but can not completely replace other data such as the SQLite database is stored.

    2.SharedPreferences based on the XML file to store key-value key used to store configuration information(mainly user preference for your application).

    3.Sharedprefrece just like cookies in web which store some basic information at client side.

提交回复
热议问题