Frage

I have developed an application that can fetch data(Images and Text) from server using json parsing so my question is i am trying to implement like one time data download and store some where in my device and when I am run again application it fetch data from device not from web services so any one can sort out this problem right now i am using sqLite database for storing data

War es hilfreich?

Lösung

Just create a SQLite DB (it's very simple, you can start reading from here http://developer.android.com/guide/topics/data/data-storage.html#db or here http://developer.android.com/guide/topics/data/data-storage.html) and add a timestamp to the data you've fetched from the Web. Then once you start your app if data in DB is quite old (calculate the difference between timestamp and current time), then just pull the new data.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top