Reputation: 529
My Android App uses News API to get news and set it on RecycleView. How can I check new news? app should work in the background and immediately updates new posts in View.
Upvotes: 0
Views: 1320
Reputation: 3972
Make a service that runs every hour (for example) and get the latests News. Its important to save the last access date to push only news in the interval betwen this date and current date.
Pay attention to 4G limits and battery use.
You can use Timer Class to implement this. https://developer.android.com/reference/java/util/Timer.html
Upvotes: 1