Reputation: 4563
I have made a RSS reader application and everything works fine , as the last task I want a service or background activity or something that check for news updates and send notifications.
I wanted to know where and how to start!
my app works like this:
the user inserts a channel URL (for instance bbci/news/rss.xml) myRssReader with help of its Handler fetch the xml and retrieves data from it ; which contains:
channel name, channel description , las publication date and store them in SQLite database and get populated on a listView and user by clicking on each channel starts another activity which shows news feeds.
my idea was like having a service to for instance every 2 hours checks the channel publication date compare it with previous stored publication date and make notification if it is changed
but don't know where and how to start.
if any one can give me hints
Upvotes: 1
Views: 968
Reputation: 6112
First since you are a beginner read about Intent Services
, AlarmManager
and XML parsing.
From my experience I will advice you to read about XmlPullParser
for parsing.
Now setup up an Alarm using the Alarm Manager which fires at an interval specified by you, which starts the Intent service. the service parses and checks the RSS feed update time, if it more than 2 hrs (or any interval you want), the service will download the latest updates and finish itself.
With AlarmManager you can easily setup an interval, which you can also customize with some Dialog Time picker.
Upvotes: 1