Reputation: 617
Which is the best method to cache data coming from a restful webservice locally in Android app (categories, products, ..)? XML, sqlite or something else? Which is the best approach from performance point of view? and what about the size of the app?
Upvotes: 2
Views: 932
Reputation: 623
There are a lot of options to consider.
As a whole, I would say the best method is to rely on what others have figured out, and not re-inventing the wheel.
For a restful webservice take a look at Square's Retrofit which relies OkHttp which relies on HTTP caching standards, which uses DiskLruCache for caching to memory and later to disk.
Using this technique will allow the caching layer to be automated and you dont have to worry about it, while gaining the benefits.
This is kind of the umbrella use case though. It really depends on what you need, but for the most part this technique should cover your bases.
Upvotes: 1