Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

137 lines (84 sloc) 6.651 kb

Get started with Mobile Services

[AZURE.INCLUDE mobile-services-selector-get-started]

This tutorial shows you how to add a cloud-based backend service to a Xamarin.iOS app using Azure Mobile Services. In this tutorial, you will create both a new mobile service and a simple To do list app that stores app data in the new mobile service.

If you prefer to watch a video, the clip below follows the same steps as this tutorial.

Video: "Getting Started with Xamarin and Azure Mobile Services" with Craig Dunn, developer evangelist for Xamarin (duration: 10:05 min)

[AZURE.VIDEO getting-started-with-xamarin-and-mobile-services]

A screenshot from the completed app is below:

Completing this tutorial requires XCode and Xamarin Studio for OS X or the Xamarin Visual Studio plug-in for Visual Studio on Windows. The sample will run on iOS 5.0 and newer.

[AZURE.IMPORTANT] To complete this tutorial, you need an Azure account. If you don't have an account, you can sign up for an Azure trial and get up to 10 free mobile services that you can keep using even after your trial ends. For details, see Azure Free Trial.

Create a new mobile service

[AZURE.INCLUDE mobile-services-create-new-service]

Create a new Xamarin.iOS app

Once you have created your mobile service, you can follow an easy quickstart in the Management Portal to either create a new app or modify an existing app to connect to your mobile service.

In this section you will create a new Xamarin.iOS app that is connected to your mobile service.

  1. In the Management Portal, click Mobile Services, and then click the mobile service that you just created.

  2. In the quickstart tab, click Xamarin.iOS under Choose platform and expand Create a new Xamarin.iOS app.

    This displays the three easy steps to create a Xamarin.iOS app connected to your mobile service.

  3. If you haven't already done so, download and install Xcode (we recommend the latest version, Xcode 6.0, or newer) and Xamarin Studio.

  4. Click Create TodoItems table to create a table to store app data.

  5. Under Download and run app, click Download.

    This downloads the project for the sample To do list application that is connected to your mobile service and references the Azure Mobile Services component for Xamarin.iOS. Save the compressed project file to your local computer, and make a note of where you saved it.

Run your new Xamarin.iOS app

The final stage of this tutorial is to build and run your new app.

  1. Browse to the location where you saved the compressed project files, expand the files on your computer, and open the XamarinTodoQuickStart.iOS.sln solution file using Xamarin Studio or Visual Studio.

  2. Press the Run button to build the project and start the app in the iPhone emulator, which is the default for this project.

  3. In the app, type meaningful text, such as Complete the tutorial and then click the plus (+) icon.

    This sends a POST request to the new mobile service hosted in Azure. Data from the request is inserted into the TodoItem table. Items stored in the table are returned by the mobile service, and the data is displayed in the list.

    [AZURE.NOTE] You can review the code that accesses your mobile service to query and insert data, which is found in the TodoService.cs C# file.

  4. Back in the Management Portal, click the Data tab and then click the TodoItems table.

    This lets you browse the data inserted by the app into the table.

Next Steps

Now that you have completed the quickstart, learn how to perform additional important tasks in Mobile Services:

Jump to Line
Something went wrong with that request. Please try again.