问题
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}]}]}
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?
回答1:
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.
And if the data is small, data is premitive type and you don't want to share it with user then SharedPreference is good.
Choice is yours.. Thanks.
回答2:
both have different purposes .
for small sized primitive data's where you don't want to invoke any queries use shared preferences .
for large sized , complex type storage , use sqLite
来源:https://stackoverflow.com/questions/7966751/sqlite-or-shared-preferences