commas-leftThis article provide sample code for developer to access Azure Services with Microsoft Xamarin Cross platform mobile app.commas-right

Xamarin  Azure

Azure Mobile Service

With the Mobile Apps feature of Azure App Service, it is easy to rapidly build cross-platform and native apps for iOS, Android, Windows or Mac. Store app data on cloud or on local device, authenticate users, send push notifications or add your custom backend logic in C#.

You can add structured storage, push notifications, authentication, and more to your Xamarin based mobile application using Microsoft Azure Mobile Apps.

You will create both a new Mobile App backend and a simple Xamarin.Forms app that stores app data in Azure.

Prerequisites

  • XCode 4.5 and above (for building iOS Apps)
  • Xamarin Tools
  • A Windows Azure subscription (Free Trial)

Creating an Azure Mobile Services using C#.NET backend

If you are starting a new project, you can develop an App Service using either the Azure Portal or Visual Studio and that delivers you the entire project stucture of the Services with some sample files. This section will help you use one of these to build a new mobile app backend which hosts a simple API. You can run this locally or publish the project to your cloud-based App Service mobile app.

Defining the model

Create Controller with the needed methods

Configuration Mobile App Service with the Azure keys & credentials

After Creating an Azure Mobile Services using C#.NET backend, we need to build the project and deploy it to Azure server.

Create a Xamarin forms Application.

To implement Azure Mobile Service in Xamarin project, we need to include Azure Mobile Client SDK using package manager of the Development Tool and this SDK will help to communicate with the Azure Service.

Add Application URL which will used by MobileServiceClient object to connect with Azure Service

Now Create Model in Xamarin Forms Application

Create Manager class for manage insert, retrive, update date in azure tables

Finally we need to add below Call in all the Platform to init the MobileServic

Call Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); in your Xamarin.iOS and Xamarin.Android application.

Contact us for xamarin mobile application development. We have highly experienced team of Xamarin developers at competitive rates with best client experiences!

Contact Us

Image Designed by Freepik

Related Blogs

Comment (0)

Leave a Reply

Your email address will not be published. Required fields are marked *