jeudi 16 juillet 2015

Shared Preferences vs SQLite for caching JSON

What is the best way to persist a JSON in between Android application life cycles? Right now I am using a rest service to return a JSON. I use this JSON as a data provider for a javascript chart I am loading into a large amount of webviews. I don't want to continuously hitting the server to request the JSON, instead I want to cache it and retrieve it when needed allowing the user to manually update/refresh the data.

Should I be doing this with Shared Preferences or should I persist to a SQLite table? My main concern is still being able to retrieve the stored data even after the application has been killed/restarted. I also have a large amount of JSONs and want to know which would be the most efficient.

Aucun commentaire:

Enregistrer un commentaire