1

I'm reading JSON data from a PHP Service and everytime the version of that JSON changes, I want to store it on Android (replace the old data with the new one), the JSON is used only for fill a Spinner.

My question is: - The JSON has 36KB, is OK to store it on Shared Preferences has a String or should I use SQLite to store it?

There will be one update per month

Example of my data : http://zimp.hugo.webe.pt/api/occupations/list

Luis Neves
  • 1,067
  • 2
  • 10
  • 21

4 Answers4

3

if its a json String, having many records, values, then I would recommend to parse this string into records, and then save these records to sqlite, so that you wont need to parse this string again, and again, un-necessarily. otherwise, there isn't any issue in saving string into sharedpreferences.

According to your data, you should opt for SQLite.

jeet
  • 29,001
  • 6
  • 52
  • 53
1

It's fine to store it in shared preferences.

Anders Metnik
  • 6,096
  • 7
  • 40
  • 79
0

Not a problem to save in shared preference..but keep in mind that SP mostly saves primitive data types in key value pair...and not an issue of 36kb in your case.:)

Kalpesh Lakhani
  • 1,003
  • 14
  • 28
0

It's Depend on your data.

  • If your data should be dynamic and change frequently then you must use JOSN.
  • If YOUR data is not Not regular update and not a large size then store in shared preferance.
  • if your data large then store in database.

Now you have to decide which one you select.

Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85