SQLite的或共享preferences [英] SQlite or Shared Preferences

查看:101
本文介绍了SQLite的或共享preferences的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序,我收到的数据像这样JSON:

In my android app I receive data as json like this:

    "_playLists":[{"name":"Playlist 1",

    "items":[{"name":"Poza 1","target":"...","url":"...","url_thumb":"..."},

    {"name":"Poza 2","target":"http:\/\/audifrance.fr","url":"...","url_thumb":..."}]},


    {"name":"Playlist 2",
    "items":[{"name":"Poza 3","target":"...","url":null,"url_thumb":null}]}]}

我的问题是:这是从这个响应保存数据的最佳方法:使用共享preferences或使用一个数据库SQLite的?是否有可能使用共享preferences使保存的数据之间的连接?

My question is : which is the best way to save data from this response: using Shared Preferences or using a database SQlite? Is it possible using Shared Preferences to make connections between the saved data?

推荐答案

如果有无安全问题的数据,数据是复杂类型​​数据是在大量我觉得 SQLite是最适合它

If there is no security concern with data, data is complex type and data is in large amount I think SQLite is the best for it.

如果数据很少 数据是premitive型您不想使用用户分享它,然后共享preference还是不错的。

And if the data is small, data is premitive type and you don't want to share it with user then SharedPreference is good.

选择是你的..谢谢。

这篇关于SQLite的或共享preferences的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆