Consuming the Patch News API — HelloNews
Having had a detailed look at the Patch News API, let us fire some code to consume it:
1. Start Visual Studio 2010 Express and create a new Windows Phone Application named
HelloNews
.2. Download the
MD5Managed
class from http://archive.msdn.microsoft.com/SilverlightMD5, and add it your solution using the Solution Explorer's Add | Existing Item option.3. Download the
Json.NET
library from codeplex.com at http://json.codeplex.com/; extracting it creates the Json45r7\Bin\WindowsPhone directory which contains the files we need. We will use this library to parse JSON within our example application.4. Add the
Json.NET
library to your solution as a reference by browsing to the directory where you have downloaded the library; see the following screenshot:5. Import
System.Device.Location, System.Text, System.Diagnostics, Microsoft.Phone.Tasks, Newtonsoft.Json
, and theNewtonsoft.Json.Linq
namespaces as shown in the following code snippet within yourMainPage...