Monthly Archives: January 2019

Added a clicking command to Labels (and more)

I wanted to have a clickable label in my Xamarin Forms application. A button was just a little too large for my requirements, but a standard Label does not have a click command. However, it’s easy to create such an command handler, this also works for other UI elements.

In your XAML just use the GestureRecognizers collection and add a TapGestureRecongizer, like this

<Label Text="More...">
      <TapGestureRecognizer Command="{Binding MoreCommand}" />


Preparing a Xamarin Forms app. for deployment to Android

So I’ve created a cross platform application using Xamarin Forms and Visual Studio 2017 and now I want to get it deployed on some devices – in this post I’m concentrating on Android devices. So let’s look at what we need to do to get this application deployed…

I’m going to assume that the application version, icon, permission requirements and all those “standard” things have been implemented/setup and concentrate on getting the application ready for deployment to our device(s).

Release build

Obviously, like any other application, we’ll want to minimize the size of our application and remove any debug centric code that might be wrapped in #if DEBUG etc.

Select the Android project (ensure the build is set to Release), right mouse click and select properties and in Android Options ensure Use Shared Runtime and Use Fast Deployment (debug model only) are unchecked.

Archive and prepare for distribution

The process of bundling up an Android application is known as generating an archive. Right mouse click on the Android project in your solution and select Archive. Visual Studio will now go about archiving your application bundle.

Now click the Distribute button where you’ll be able to target the application’s distribution channel. I have two options Ad Hoc and Google Play. I’m going to stick to Ad Hoc which allows me to use email, a web site etc. to distribute my application via side loading.

We need to sign our application, so if you’ve not yet got a keystore/identity set-up you can just click the + button.

Note: Even if you’re just creating a new keystore for each application you’ll need to make sure you remember your password as this will be required to complete the signing process.

Fill in the options and then press Save As and you’ll be prompted for the keystore password.

We have now created an APK which can be installed onto you Android device. In my case I’m using Microsoft’s AppCenter to allow specific users to access the application for testing.


Preparing an Application for Release
Signing the Android Application Package