Question

I am looking for a way to show the number of unread articles from an RSS feed on a live tile on Windows Phone. How can I do that? I know that I can use background tasks, but I want to use them effectively, so I don't drain the battery of the phone by checking the feed over and over again. Also, I want to reset that number when I open the app.

Was it helpful?

Solution

There are 2 ways of updating the tiles.

  1. From within the app (or background agent)
  2. From a remote service, via push notifications

The method with the least impact on the battery is to send push notifications when there is a new article. This does require a backend service capable of identifying when new content is posted and sending the push notifications though.

If you want to do it all on the device using background agents, the important thing is to remember to not pull down all the content each time. If you have control over the backend then add the ability to return how many new articles there are. If not, only pull down the feed if necessary. Look at the If-Modified-Since header for one way to do this.

It's very easy to reset/clear the tile contents from within the app when launched. When you navigate forwards into the main page is normally the best time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top