Skip to content

Developing Windows Phone 7 apps that consume SharePoint data

March 22, 2012

Recently I was creating a WP7 app which needed to consume data from SharePoint lists. Now I want to summarize and share my findings and experience:

Resources

There are fewer online resources on this topic than I expected. The most valuable resource was the SharePoint 2010 and Windows Phone 7 Training Kit (which I found unfortunately too late)

Limitations

There are some limitations that make the development more painful than a developing for a standard desktop environment:

  • There is no SharePoint object model for WP7, so we can’t use the traditional approach to access SharePoint data using the SPSite, SPWeb, SPList, SPListItem, etc objects. This was a surprise as this works fine from Silverlight, but not from WP7, unfortunately.
  • Windows authentication is not supported when accessing SharePoint from a WP7 app. Generally handling authentication is quite challenging.
Options

RSS: if you just want to read data form SharePoint in a WP7 app, you can read the OOB SharePoint RSS feeds that are available for every list. The hard part here (besides authentication) is parsing the RSS xml and retrieving the required data from the feed.

Web Services: standard SharePoint web services (under the _vti_bin url) are available and can be used for both Reading and Writing data. The functionality however is limited compared to the Object Model and the programing against the web services is more painful, too. In most cases however, probably it is the best option.

Custom web services: If you are in the position to develop and deploy custom web services on the SharePoint farm, then in many cases you can simplify the client side logic and make functions available via the custom web service that are otherwise not provided by the OOB web services. In this case however you will not only need to develop for the phone, but for the SharePonint farm too, which brings in an additional level of complexity.

REST API: Possible, but you need to struggle with passing credentials for authentication to the server. This is not supported OOB, so you will need to do some extra coding.

Authentication

Authentication is hard part of the development.
By default, only Forms Based Authentication (FBA) is supported.
If you have Forefront Unified Access Gateway 2010 (UAG) available in your network infrastructure, then you can use it to translate the credentials on the fly and this way you can access SharePoint content via Basic authentication. (which is windows authentication, but sending username/password in plain text over the network) Note that UAG requires additional licensing costs and operational effort, so it you don’t use it already then probably it is not an option.

Summary

Developing WP7 apps that consume SharePoint data is possible, but with severe limitations and with considerable extra development effort. A good resource is the SharePoint 2010 and Windows Phone 7 Training Kit which comes with several samples and tutorials.

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: