0
votes

I made a RSS reader app for android and it gets the latest news from a RSS feed. I want to show a Notification to the user when a news is published to the website or the RSS feed. How can I check for new data?

1
Probably you will have to create background service that periodically check for updates. - Yupi
@Yupi can you please guide me a little because I am new to android - Naqib Shayea Qazizadah

1 Answers

0
votes

You can create something which is called polling. Actually many rss reader apps using polling technique in which their service wakes up at a regular interval to contact a server to see if new data needs to be processed. This means that the application needs to wake up to look for new data even if none is available to be processed. Read about IntentService and AlarmManager. Basically you can create AlarmManager which is going to start every amount of time that you want for example every hour. Than you can start a service which is going to check is new data available. If it is new data for processed available raise a notification on user phone. Set AlarmManager to fires up again for an hour and the service should shutt down itself. Hope this will help.