This post explains the steps to create a Windows Phone application using HTML5 and OData. You need to install Windows Phone SDK on developer machine which can be downloaded from here. The idea is to show the product categories information from Northwind OData service.
1. Create a ASP.NET Web application and refer the Northwind OData service
2. Add the Jquery and datascript libraries into the web application. datajs scripts can be downloaded from here
4. Add a Application script file (app_code.js) under same folder as jquery and datajs files.
5. Write the below code in app_code.js file which populates the category list
6. Call the ShowCategories in document.ready function
8. Make sure the .htm , .js and .css files have the their build action property set to content in Visual Studio
9. Add the web browser control in Mainpage.xaml page and set the IsScriptEnabled=true
10. Add the initialization code and page loading code in code-behind file of the Mainpage.xaml
Reference: OData Programming Cookbook for .NET developers. I highly recommend to read this book as it contains many practical code snippets for the developers on OData.
|Share this post :|