Microsoft Azure Mobile Apps with Xamarin Android – jump start

Microsoft Azure Mobile Apps with Xamarin Android – jump start

azureAndroid1

Short introduction

Microsoft Azure App Service is fully managed Platform as a Service (PaaS). It gives developers a rich set of capabilities connected with web and mobile.

Mobile Apps platform is a part of it that offers high scalability in mobile development. Mobile developers can us Azure Mobile Apps for storing data in the cloud, offline data storage and background synchronization, authenticating users or sending push notifications.

It is accessible from all popular mobile platforms: Android, iOS and Windows.

Azure Mobile App integration with Xamarin Android

What do I need to start?

1) Visual Studio 2013 Community (for free) or higher

2) Microsoft Azure subscription (you can test it for free here)

3) Xamarin Android subscription (you can test it for free here)

4) Android Phone or Xamarin Android Player Emulator (download here)

1) Configure your Mobile App on the Azure Portal: Azure Portal

a) Select “Web+Mobile” optiion and then “Mobile App”:

azureAndroid2

b) Type the name for your Mobile App Service and choose “S1 Standard Plan”:

azureAndroid3

c) Create new “Resource Group” (in souch group you can collect you resources like website or database) and new “App Service plan”(set of features you can share between apps):

azureAndroid4

d) After that you must configure database for you Mobile App. Click “Package settings” -> “USERDATABASE”  and then “Create a new databse”.

There you must also provide name for your database, “Pricing Tier” (it is just a pricing plan and offer), choose “S1 Standard”:

azureAndroid5

e) Last point is connected with database server configuration. Insert “Server name”, “Admin login”, “Password” (this will enable access to you databse in the future). You must also choose “LOCATION” I have selected “North Europe” because it is cheaper for the region I live.

azureAndroid6

f) Your Azure Mobile App is ready to create:

azureAndroid7

g) If you configured everything, you should see the screen below. Our Azure Mobile App is ready!

azureAndroid8

What’s next?!

1) Select “Browse all” section on the left bar ->Mobile Apps and the select the app you created above:

azureAndroid9

2) Click “Add Client” option. Download “Server Project” with number 2 and “Xamarin.Android” project with number 3:

azureAndroid10

3) You have to also download “Publish Profile” With it you will be able to publish your Aure Mobile App from Visual Studio:

azureAndroid11

Done! Now you can open your Mobile App project in Visual Studio. Firstly open the “Server project” version:

azureAndroid12

1) Build the whole solution:

azureAndroid13

2) Import “Publish profile” you have downloaded earlier:

azureAndroid14

azureAndroid15

3) Validate connection with Azure:

azureAndroid16

4) In this step set “Configuration” to “Release”. Click “Next”. Do not worry about other information displayed. I will write about it in the next post.

azureAndroid17

5) Click “Publish”. When its finished your browser should open with the next screen below:

azureAndroid18

azureAndroid19

That’s it! Your Azure Mobile App is working properly! Let’s open Xamarin.Android project now and connect to our Azure app!

1) Firstly open and build whole solution:

azureAndroid20

azureAndroid21

2) Launch Xamarin Android Player emulator (or connect you Android phone with developer options enabled):

azureAndroid22

3) Start project:

azureAndroid23

4) Our Xamarin Android app is connected with Azure Mobile App! Now you can add new item or select one for deleting:

azureAndroid24

azureAndroid25

This is the last point. You have created your Azure Mobile App and connected it with your Xamarin Android application.

Sum up

In this post I tried to show how easily you can create Mobile App on Microsoft Azure cloud platform.

In the next post I will go through the code for both projects: server and mobile so you can understand how exactly this whole integration works.

Enjoy!

Advertisements