Tuesday 16 March 2010

Windows Phone 7 Series and OData / WCF Data Services feeds

This post has moved to http://wishfulcode.com/2010/03/16/windows-phone-7-series-and-odata-wcf-data-services-feeds/

Whilst the Windows Phone Series 7 development tools were only released yesterday, you can tell that various other Microsoft teams have been working hard to make sure their technologies are useable in the new environment.

The first thing I attempted to do on the phone was build some apps which interacted with their data through WCF Data Services. I found it wasn't yet as simple as the normal .net experience, but you can tell that's where things are headed.

Things to keep in mind when attempting to consume oData services on a Windows Phone 7 Series silverlight app:
  • At dev time, you won't for now be able to simply "Add Service Reference" to your data service. You'll have to grab the preview client tools (which you should reference from your consuming silverlight library and the application itself). You'll then need to manually generate the classes for the client.
  • The rest of the experience is pretty similar to desktop Silverlight apps - you have to code in an asynchronous manner.
  • Remember that your app will be running inside a virtual machine (if using the emulator), and so won't be able to access Urls on your dev machine as local. Instead, you can reference your development machine via it's name.
Once up and running, it'll be a very quick, simple and powerful way to reach your data, and the included best-practice templates for the phone projects look like we're going in a great direction.