Android App Development and the Visual Studio Mobile Centre
Tags: softwaredevelopment, app, azure, development
Published: 2020-02-14 19:45:08

---
title: Android App Development and the Visual Studio Mobile Centre
published: true
date: 2017-08-07 07:00:37 UTC
tags: SoftwareDevelopment,app,Azure,development
canonical_url: https://www.funkysi1701.com/posts/android-app-development-and-the-visual-studio-mobile-centre-2o2
---

For the past week or so I have been playing around with Xamarin and creating an android app.

Well I now have an app in the Google Play Store. Check out [https://play.google.com/store/apps/dev?id=6148298088834956775](https://play.google.com/store/apps/dev?id=6148298088834956775). ![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2017/08/Screenshot_20170806-190053.png?resize=169%2C300&ssl=1)

Before you rush and download the app I must warn you that it doesn’t do much yet. It displays some content that is on my website and there are a few links to allow sharing of content. I have some ideas to display content from my blog and allow sharing. I also have some other ideas for apps that might actually be useful to people that are not me. If you have ideas or feature requests do let me know.

Ok how did I go about creating this app and getting it in the app store?

Xamarin is now part of Visual Studio so step one is install all the Xamarin features to Visual Studio and build an app.

Next I wanted to monitor my app. Now I know Application Insights doesn’t support apps so what tools are out there? [HockeyApp](https://hockeyapp.net/)is something I had heard of but they are in the process of being replaced with [Visual Studio Mobile Centre](https://mobile.azure.com/apps).

It was relatively easy to hook up my app to Visual Studio Mobile Centre. First install the required nuget packages. Then add using statements and the following line to your MainActivity.cs file (these instructions are available on the Mobile Centre)

`using Microsoft.Azure.Mobile;
using Microsoft.Azure.Mobile.Analytics;
using Microsoft.Azure.Mobile.Crashes;
using Microsoft.Azure.Mobile.Distribute;
using Microsoft.Azure.Mobile.Push;`

`MobileCenter.Start("[Unique ID]",typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Push));`

Now you can connect the Mobile Centre to your source code (VSTS in my case) and get it to run a build for every commit.

One complexity of the build is that you need to supply a keystore file (basically a certificate to digitally sign your app). I found the best way to do this was to use Visual Studio to create the file.

In VS2017 there is a option called Archive Manager under the tools menu. In here click the distribute button and select Ad-hoc. In the signing identity section you can create a keystore file. Enter a few details and a keystore file will be created in AppData\Local\Xamarin\Mono for Android\Keystore\[keystore name]\[keystore name.keystore]

Once you have added the keystore file to your build you can enable the distribute option. Now you will get an email after every build with a link to install your app. You can also enable a build status icon like this  ![build status](https://build.mobile.azure.com/v0.1/apps/c13c4e24-b40b-432b-87be-e1351f2fca47/branches/master/badge).

Every time your app crashes the details will be logged in the crashes section for you to explore and fix the issues.

The Analytics section allows you to explore how your app is being used. You can also add Analytics.TrackEvent(“Feature X”) to measure the usage of different features.

There are more things you can do which I will explore more at another time along with how to get your app into the Google Play Store.