SQLite的或共享preferences [英] SQlite or Shared Preferences
问题描述
在我的Android应用程序,我收到的数据像这样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屋!