Home > Articles > Programming > Visual Studio

Your Data Everywhere, Part 3: Consuming LightSwitch's OData Services from Windows Phone Apps

  • Print
  • + Share This
  • 💬 Discuss
Alessandro Del Sole, author of Microsoft Visual Studio LightSwitch Unleashed, concludes his three-part series on the usefulness of the new support for Open Data Protocol in the latest version of LightSwitch. You've learned how to work with OData services from your LightSwitch apps and experienced the power of exposing data sources in your clients to OData services. He wraps up the discussion by stepping through the creation of a Windows Phone app that can work with OData feeds from LightSwitch.

As discussed in part 1 and part 2 of this series, LightSwitch in Visual Studio 2012 produces OData feeds for every data source. This is a tremendous benefit because with OData you can expose data to a variety of client applications, including mobile applications. This article concludes this series by showing you how to create a Windows Phone app that is capable of working with OData feeds produced by LightSwitch.

Overview of Developing for Windows Phone

Windows Phone is Microsoft's most recent operating system for mobile devices. Microsoft has done a great job of offering a convenient development environment for building Windows Phone applications inside Visual Studio 2010, so that developers can use the IDE and programming languages they already know. You can build applications for Windows Phone 7 and 7.5 by installing the Windows Phone 7.1 SDK on your machine. At the time of writing, such developer tools were only available for Microsoft Visual Studio 2010, so you'll need this edition of the development environment to build mobile apps (which applies to the sample project discussed in this article). You can also take advantage of the free Visual Studio Express for Windows Phone. For the sake of consistency, in this article we use Visual Studio 2010.

Developing apps for Windows Phone relies on a version of Silverlight that is specific to Windows Phone, so if you have some experience with Silverlight or Windows Presentation Foundation (WPF), you're already familiar with building mobile apps for the new operating system. The Windows Phone developer tools install project templates, libraries, a device emulator required for local testing, and all the other necessary tools to help you as a Windows Phone developer.

OData Support in Windows Phone Development

As with other platforms, working with data on the Windows Phone OS is a key topic. For this reason, Windows Phone fully supports OData services through a special client library. This library is already included in the SDK, so you don't need to install anything else. The library is available through an assembly called System.Data.Services.Client.dll, which will be added for you automatically when you reach the OData service. I'll explain more shortly, but before we get to the mobile client, it's a good idea for you to understand how to secure the OData services produced by LightSwitch. This is very important when exposing your data through public networks such as the Internet.

  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus