문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top