Monday, April 28, 2014

Using OAuth, Twitter and Async To Display Data - Connect to Twitter from a mobile application using OAuth with the Xamarin.Auth library, along with Joe Mayo's LINQ To Twitter library

Authentication has been a part of .NET for a long time. Unfortunately, there are a couple of problems:
  • Users must remember their user ids and passwords. For technologists, this is not a problem. For my parents, this is a huge challenge. Many people are able to remember their Twitter or other social network passwords. Unfortunately, remembering their user IDs and password for your service is most likely a problem.
  • When an application is responsible for the user IDs and passwords, it must store that information securely in some way. If there's one thing we should all understand, no application is 100 percent secure. There is always the chance for some type of data loss.
Depending on the application's needs, it may make sense to let another service store user IDs and passwords. The next question is, "Is there a standard way to interact with other services that can handle authentication?" Thankfully, there is a standard for cross-application authentication: OAuth. OAuth has been implemented by a number of social networks and other services, including Twitter, Facebook, Google and others.
OAuth is an open standard for authorization. It provides the following:
  • A standard method for client authentication.
  • A standard process for end users to authorize third-party access to server resources.
  • The ability to authorize these third parties without the sharing of credentials (username and password pair).
This article will not get into OAuth specifics; that information is available on the OAuth Web site.
For these set of examples, we'll use OAuth as a mechanism to authenticate users. We'll authenticate users, get a response and display information to the user (specifically, a profile image). From there, the example will integrate with Twitter via OAuth and then make calls to Twitter via a third-party library. This will demonstrate the strength of the growing Xamarin ecosystem.
Url: http://visualstudiomagazine.com/articles/2014/04/01/using-oauth-twitter-and-async-to-display-data.aspx

Wednesday, April 2, 2014

Build a Cross-Platform, Mobile Golf App Using C# and Xamarin - MSDN Magazine Article

One of the fun things about the return of golf season is participating in tournaments that feature events such as a longest drive contest. In these, a person’s first shot off a designated hole is measured against others in the tournament. The longest drive during the day is declared the winner. However, these contests typically don’t have centralized scoring. If you’re in the first group, you don’t know until after the event is over where your shots stand in relation to everyone else’s. Why not use a mobile phone to record the starting point and ending point of drives and store the information in a cloud-hosted database?
The options for building such an app are many, which can be confusing. In this article, I’ll walk through how I built such an app using the back-end options in Windows Azure and how I handled various issues. I’ll show the code for writing an app for Windows Phone as well as iOS using Xamarin.
Several features were required. The app needed to run across mobile devices and multiple device OSes. It had to be a native app that looked just like all of the others on a device. The back-end server had to be always available, with minimal hassle to the developer (me). The cloud services had to provide as much help as possible in the area of cross-platform development. The back-end database needed to provide some amount of geolocation functionality.

Many thanks to Brian Prince, Kevin Darty, Tara Walker, Craig Dunn, and a host of others for reviewing the article
PS. You don't have to go to Build to get this Cross Platform Awesomeness