Skip to content

Latest commit

 

History

History
179 lines (131 loc) · 9.84 KB

app-service-mobile-xamarin-forms-get-started.md

File metadata and controls

179 lines (131 loc) · 9.84 KB
title description services documentationcenter author manager editor ms.assetid ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
Get Started with Mobile Apps by using Xamarin.Forms
Follow this tutorial to get started using Azure Mobile Apps for Xamarin.Forms development
app-service\mobile
xamarin
adrianhall
erikre
5e692220-cc89-4548-96c8-35259722acf5
app-service-mobile
mobile
mobile-xamarin
dotnet
hero-article
10/01/2016
adrianha

Create a Xamarin.Forms app

[!INCLUDE app-service-mobile-selector-get-started]

Overview

This tutorial shows you how to add a cloud-based backend service to a Xamarin.Forms mobile app using an Azure Mobile App backend. You will create both a new Mobile App backend and a simple Todo list Xamarin.Forms app that stores app data in Azure.

Completing this tutorial is a prerequisite for all other Mobile Apps tutorials for Xamarin.Forms.

Prerequisites

To complete this tutorial, you need the following:

Note

If you want to get started with Azure App Service before signing up for an Azure account, go to Try App Service, where you can immediately create a short-lived starter Mobile App in App Service. No credit cards required; no commitments.

Create a new Azure Mobile App backend

Follow these steps to create a new Mobile App backend.

[!INCLUDE app-service-mobile-dotnet-backend-create-new-service]

You have now provisioned an Azure Mobile App backend that can be used by your mobile client applications. Next, you will download a server project for a simple "todo list" backend and publish it to Azure.

Configure the server project

Follow the steps below to configure the server project to use either the Node.js or .NET backend.

[!INCLUDE app-service-mobile-configure-new-backend]

Download and run the Xamarin.Forms solution

Here you have a couple of choices. You can download the solution to a Mac and open it in Xamarin Studio, or you can download the solution to a Windows computer and open it in Visual Studio using a networked Mac for building the iOS app. See Setup and install for Visual Studio and Xamarin if you need more detailed instructions on the Xamarin setup scenarios.

Let's proceed:

  1. On your Mac or on your Windows computer, open the Azure Portal in a browser window.

  2. On the settings blade for your Mobile App, click Get Started (under Mobile) > Xamarin.Forms. Under step 3, click Create a new app if it's not already selected. Next click the Download button.

    This downloads a project that contains a client application that is connected to your mobile app. Save the compressed project file to your local computer, and make a note of where you save it.

  3. Extract the project that you downloaded, and then open it in Xamarin Studio or Visual Studio.

(Optional) Run the iOS project

This section is for running the Xamarin iOS project for iOS devices. You can skip this section if you are not working with iOS devices.

In Xamarin Studio

  1. Right-click the iOS project, and then click Set As Startup Project.
  2. On the Run menu, click Start Debugging to build the project and start the app in the iPhone emulator.

In Visual Studio

  1. Right-click the iOS project, and then click Set as StartUp Project.

  2. On the Build menu, click Configuration Manager.

  3. In the Configuration Manager dialog box, select the Build and Deploy checkboxes of the iOS project.

  4. Press the F5 key to build the project and start the app in the iPhone emulator.

    [!NOTE] If you have problems building, run NuGet package manager and update to the latest version of the Xamarin support packages. Sometimes the Quickstart projects may lag behind in being updated to the latest.

In the app, type meaningful text, such as Learn Xamarin and then click the + button.

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

Note

You'll find the code that accesses your mobile app backend in the TodoItemManager.cs C# file of the portable class library project of your solution.

(Optional) Run the Android project

This section is for running the Xamarin droid project for Android. You can skip this section if you are not working with Android devices.

In Xamarin Studio

  1. Right-click the Android project, and then click Set As Startup Project.
  2. On the Run menu, click Start Debugging to build the project and start the app in an Android emulator.

In Visual Studio

  1. Right-click the Android (Droid) project, and then click Set as StartUp Project.

  2. On the Build menu, click Configuration Manager.

  3. In the Configuration Manager dialog box, select the Build and Deploy checkboxes of the Android project.

  4. Press the F5 key to build the project and start the app in an Android emulator.

    [!NOTE] If you have problems building, run NuGet package manager and update to the latest version of the Xamarin support packages. Sometimes the Quickstart projects may lag behind in being updated to the latest.

In the app, type meaningful text, such as Learn Xamarin and then click the + button.

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

Note

You'll find the code that accesses your mobile app backend in the TodoItemManager.cs C# file of the portable class library project of your solution.

(Optional) Run the Windows project

This section is for running the Xamarin WinApp project for Windows devices. You can skip this section if you are not working with Windows devices.

In Visual Studio

  1. Right-click any of the Windows projects, and then click Set as StartUp Project.

  2. On the Build menu, click Configuration Manager.

  3. In the Configuration Manager dialog box, select the Build and Deploy checkboxes of the Windows project that you chose.

  4. Press the F5 key to build the project and start the app in a Windows emulator.

    [!NOTE] If you have problems building, run NuGet package manager and update to the latest version of the Xamarin support packages. Sometimes the Quickstart projects may lag behind in being updated to the latest.

In the app, type meaningful text, such as Learn Xamarin and then click the + button.

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

Note

You'll find the code that accesses your mobile app backend in the TodoItemManager.cs C# file of the portable class library project of your solution.

Next steps