Create a Xamarin.Android App


This tutorial shows you how to add a cloud-based backend service to a Xamarin.Android app. For more information, see What are Mobile Apps.

A screenshot from the completed app is below:

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


To complete this tutorial, you need the following prerequisites:

Create an Azure Mobile App backend

Follow these steps to create a Mobile App backend.

  1. Sign in to the Azure portal.

  2. Click Create a resource.

  3. In the search box, type Mobile Apps.

    Azure portal with Mobile Apps Quickstart highlighted

  4. In the results list, select Mobile Apps Quickstart, and then select Create.

  5. Choose a unique App name. This will also be part of the domain name for your App Service.

  6. Under Resource Group, select an existing resource group or create a new one (using the same name as your app).

  7. Click Create. Wait a few minutes for the service to be deployed successfully before proceeding. Watch the Notifications (bell) icon in the portal header for status updates.

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

Configure the server project

  1. Click the App Services button, select your Mobile Apps back end, select Quickstart, and then select your client platform (iOS, Android, Xamarin, Cordova).

    Azure portal with Mobile Apps Quickstart highlighted

  2. If a database connection is not configured, create one by doing the following:

    Azure portal with Mobile Apps Connect to database

    a. Create a new SQL database and server. You may need to leave the connection string name field to the default value of MS_TableConnectionString in order to complete step 3 below.

    Azure portal with Mobile Apps create new database and server

    b. Wait until the data connection is successfully created.

    Azure portal notification of successful creation of data connection

    c. Data connection must be successful.

    Azure portal notification, "You already have a data connection"

  3. Under 2. Create a table API, select Node.js for Backend language.

  4. Accept the acknowledgment, and then select Create TodoItem table. This action creates a new to-do item table in your database.


    Switching an existing back end to Node.js overwrites all contents. To create a .NET back end instead, see Work with the .NET back-end server SDK for Mobile Apps.

Download and run the Xamarin.Android app

  1. Under Download and run your Xamarin.Android project, click the Download button.

    Save the compressed project file to your local computer, and make a note of where you save it.

  2. Press the F5 key to build the project and start the app.
  3. In the app, type meaningful text, such as Complete the tutorial and then click the Add button.

    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 appears in the list.


    You can review the code that accesses your mobile app backend to query and insert data, which is found in the ToDoActivity.cs C# file.


If you have problems building the solution, run the NuGet package manager and update the Xamarin.Android support packages. Quickstart projects might not always include the latest versions.

Please note that all the support packages referenced in your project must have the same version. The Azure Mobile Apps NuGet package has Xamarin.Android.Support.CustomTabs dependency for Android platform, so if your project uses newer support packages you need to install this package with required version directly to avoid conflicts.

Next steps