Page 34 - MSDN Magazine, June 2017
P. 34

XAMARIN
Authentication and Data
Access with Visual Studio
Mobile Center
Alessandro Del Sole
At Connect(); 2016, Microsoft unveiled a preview of Visual Studio Mobile Center (mobile.azure.com), a new portal that offers— in one place—everything developers need to build mobile apps in a DevOps approach, from back-end services and continuous integration, to analytics and test automation. Visual Studio Mobile Center puts together the tools and services Microsoft has been offering through Microsoft Azure Mobile Apps, Visual Studio Team Services, Xamarin Test Cloud and HockeyApp. I recommend you read the article, “Mobile DevOps Exploring Visual Studio Mobile Center,” by Thomas Dohmke (bit.ly/2f7a8Wk) for a general overview of what’s available in Visual Studio Mobile Center.
In this article, I’ll focus on authentication and tables with a prac- tical approach, describing how to consume these services from a cross-platform app that runs on Android and iOS, built with
Xamarin.Forms. The sample app will show and store a list of books a user purchased and is based on the Model-View-ViewModel (MVVM) pattern for better code reuse. Some of the features described here require an Azure subscription. If you don’t have one, you can request a free trial at azure.microsoft.com. You need Visual Studio 2017 or 2015 with the latest Xamarin extensions installed to build the sample application. You can download the free Community edition from visualstudio.com.
In this article, I’ll focus on authentication and tables with a practical approach.
Adding an App to the Visual Studio Mobile Center
In order to leverage any service from Visual Studio Mobile Center, the first thing you need to do is associate a new app to the portal. To accomplish this, you need to enter the portal (mobile.azure.com) and sign in with either a Microsoft or GitHub account. The wel- come page of the Mobile Center shows a button called Add new app. As shown in Figure 1, when you click this button, you need to specify the app name, an optional description, the target OS and the development platform.
This article discusses:
• Adding an app to the Visual Studio Mobile Center
• Creating tables
• Setting up authentication
• Consuming back-end services from Xamarin clients Technologies discussed:
Xamarin, Microsoft Azure Platform, Visual Studio 2017, Android, iOS
Code download available at:
msdn.com/magazine/0617magcode
30 msdn magazine















































































   32   33   34   35   36