Is it ok to save a JSON array in SharedPreferences?

前端 未结 9 2165
不知归路
不知归路 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:28

    I have done the same thing ... serialize an objet to a json string and save it into shared prefs. No problem, but understand that ultimately the prefs are an XML file, so if you are reading / writing it a lot, it isn't going to perform well.

提交回复
热议问题