I am certainly a newbie to android.
I am building a News app. I want to add a caching feature in the app like that in chrome for android(offlin mode) and Instagram.
The data for the app will go via json from the server. So what I want is, the app requests the data from server to load the feed, and the data gets cached so that if next time the app is opened without internet connection, the cached posts get displayed(the number of posts would be limited) And the main thing, the complete articles(by clicking the post in feed and reading the whole article in another activity) that users views should also get cached such that there would be a maximum of "n" number of posts in the cache at any time, if cache get filled with n posts, the last post added to the cache would get removed and so on...
How to do I achieve this caching? As with Picasso, the cache gets reset every time the app is killed. And sharedPreferences and SQLite are kind of permanent storages.
So what is the best way to achieve this kind of cache. Are there any libraries that can be used, or should I manage to do it with sharedPreferences/SQLite/Storage??