How to Cache Json data to be available offline?

后端 未结 7 2329
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 12:55

I have parsed the JSON Data in a listview and now I want to make it available offline. Is there a way to save the JSON data at the phone so that you can see th

7条回答
  •  隐瞒了意图╮
    2020-12-08 13:08

    You can cache your Retrofit responses, so when you make the same request second time, Retrofit will take it from it's cache: https://medium.com/@coreflodev/understand-offline-first-and-offline-last-in-android-71191e92b426, https://futurestud.io/tutorials/retrofit-2-activate-response-caching-etag-last-modified. After that you'l need to parse that json again

提交回复
热议问题