cavallo
cavallo

Reputation: 4414

How to implement caching data in android instead of loading data from the server

hi in my app i have large data to be loaded from the web server and each time i call the web server it takes lot of time to load hence i decided to cache the old data and request server only when there is new data and load all the data on a DB and load it from DB offline so that the app is more responsive.

How to implement this as i have no idea about caching, please do suggest ways to implement this and what is the best DB i can use as the data from the server is in json format. what are the methods i need to follow to implement this caching in android.

Upvotes: 2

Views: 2047

Answers (1)

Taruni
Taruni

Reputation: 1671

After parsing , store the data in SQLite Database. For the first time download the data from the server and store in SQLite and show it to the user whenever user opens the app next time show the old data and do send a request to the server for new data if the new data is available update the database and change the UI.

Upvotes: 2

Related Questions