Is it ok to save a JSON array in SharedPreferences?

前端 未结 9 2149
不知归路
不知归路 2020-11-28 08:29

I have a JSON Array that I need to save. I was thinking about serializing it, but would it be better to just save it as a string in SharedPreferences and then rebuild it whe

9条回答
  •  离开以前
    2020-11-28 09:17

    It depends how big the array is. Assuming it's not ridiculously big (less than a few hundred Kb), just store it to shared preferences. If it's bigger than that, you can save it to a file.

提交回复
热议问题