In this tutorial i will write about how to pass RSS feeds into our Windows Phone 8.1 Application. It is a very simple method and it can be done by writing just few line of codes.
Before going into the implementation, let me first tell you what is RSS. It stands for "Really Simple Syndication". A way to keep update some application or content with latest information. When we subscribe with RSS feeds latest information is downloaded automatically. There is another code XML that is used in this process. Xml data is used to arrange some of the information and put the data in it. That will be discussed below.
Today i will show you how to parse RSS feeds generated from ESPN Cricinfo website from which we can embed live cricket news in our Windows app.
First go to following website: RSS Feeds Cricinfo.
Now when you open the above URL, you will see a page which have some XML markup. Look inside the XML, you will note that it has an <item> element. Inside <item> element it have <title> <description> <link> <pubDate> elements which shows that it will return Publication Date of the news along with its Title and Description.
So lets get started and open your Visual Studio 2013 and make a new blank Windows Phone 8.1 project.
Inside Grid, add a ListBox and set its ItemTemplate according to the following code.
Now open MainPage.Xaml.Cs file and add the following namespaces:
using System.Net;
using System.Net.Http;
using System.Xml.Linq;
using Windows.UI.Popups;
Next step is to add a method to get the latest RSS feed from the URL. To achieve this goal we have to create an instance of the HttpClient method as given below:
Last step is to call the GetRss( ) method in the class' constructor and we are all done. Here is the final output:
Before going into the implementation, let me first tell you what is RSS. It stands for "Really Simple Syndication". A way to keep update some application or content with latest information. When we subscribe with RSS feeds latest information is downloaded automatically. There is another code XML that is used in this process. Xml data is used to arrange some of the information and put the data in it. That will be discussed below.
Today i will show you how to parse RSS feeds generated from ESPN Cricinfo website from which we can embed live cricket news in our Windows app.
First go to following website: RSS Feeds Cricinfo.
Now when you open the above URL, you will see a page which have some XML markup. Look inside the XML, you will note that it has an <item> element. Inside <item> element it have <title> <description> <link> <pubDate> elements which shows that it will return Publication Date of the news along with its Title and Description.
So lets get started and open your Visual Studio 2013 and make a new blank Windows Phone 8.1 project.
Inside Grid, add a ListBox and set its ItemTemplate according to the following code.
Now open MainPage.Xaml.Cs file and add the following namespaces:
using System.Net;
using System.Net.Http;
using System.Xml.Linq;
using Windows.UI.Popups;
Next step is to add a method to get the latest RSS feed from the URL. To achieve this goal we have to create an instance of the HttpClient method as given below:
Last step is to call the GetRss( ) method in the class' constructor and we are all done. Here is the final output:
No comments:
Post a Comment