android-asyncservice icon indicating copy to clipboard operation
android-asyncservice copied to clipboard

What is the best practices to do a network call every hour ?

Open ipragmatechadmin opened this issue 9 years ago • 1 comments

I have used the AsyncService for the network calls which cache that data. Now I wanted to call this network service every hour and keep it in the cache so that if there is no network then data can be picked from the cache. What's the best practice to implement this solution ?

ipragmatechadmin avatar Jul 14 '15 06:07 ipragmatechadmin

There's nothing in AsyncService to help you call some code every hour, so you should implement it yourself using something like the android AlarmManager, and call your AsyncService from it. If you used @CacheThenCall, the result will be cached.

JoanZapata avatar Aug 02 '15 17:08 JoanZapata