Xamarin is offered in different licenses from free to enterprise levels but for not I will be using the starter version which is the free version. It includes the Xamarin Studio which is great start for those who want to try out creating their first apps for Android, they also offer a Business license which lets you develop in Visual Studio so you can use that rich experience similar to developing Web Apps or Windows Apps, then they have this Enterprise which contains everything. For now lets see what the free stuff can offer, I did a simple project which I will be discussing below and it looks very promising, I love it.

Like what I said above we will be using the free version so we will make this simple project by using Xamarin Studio. Now I was thinking what to do, I don’t want to create the boring "Hello World!" demo so what I will be developing is a simple calculator which acts like a normal desk calculator. Most of the calculator projects online regardless its C#, VB.Net developed as Windows
forms does not act like a normal desk calculator where you can continuously perform operations and deliver results through the screen, you can’t even change operations along the way, so I decided I will make this one and I accepted my own challenge.

Lets start! First you need to download Xamarin at Please Login or Register to view links, while installing it will ask you to download as well prerequisites but is you are a developer most or all of them are already set up in your machine.

Once its downloaded you’re ready to roll!

Fire up Xamarin Studio and select new Solution then Android Application, give it a solution name and in this case we use "Calculator".

First lets design you calculator, you need to go to that Main.axml and start coding, you will notice its like Windows form where you can drag and drop items from the Toolbox on the right, it will also have its property window on the bottom left.

Were not interested with the dragging and dropping part so let’s go the code behind (you can control it more), so hit that Source tab below the UI beside the content source. First thing you will notice is that it is in XML format, if you’re so used to drag and drop or HTML coding then you need a bit of learning here specially the layouts.

Common layouts used are Linear Layout, Relative Layout, List View and Grid View. To see how each of them would look like here is an illustration

layout_width – fill_parent will fill depending on the parent with, you can also specify a with by using something like 200dp. If you want to use percentage use 0dp but we will be indicating percentage on layout_weight.

layout_height – similar to layout_width.

layout_weight – this indicated the percentage you will use on the width.

id – identifier to the object.

layout_toRightOf – this indicates you will place this object to the right of what object Id.

layout_alignTop – this aligns your object similar to what object Id.

layout_below – this will place your object below the object Id.

other elements would sound similar to .Net object properties. Now click your content tab to see how it looks. It should be something like this

Just a side note : You might notice Calculate happens on each digit press, this makes sure you have a running total even before you hit the operator. The operator buttons will just store the current operator needed for your next digit press.

layout_width – fill_parent will fill depending on the parent with, you can also specify a with by using something like 200dp. If you want to use percentage use 0dp but we will be indicating percentage on layout_weight.

layout_height – similar to layout_width.

layout_weight – this indicated the percentage you will use on the width.

id – identifier to the object.

layout_toRightOf – this indicates you will place this object to the right of what object Id.

layout_alignTop – this aligns your object similar to what object Id.

layout_below – this will place your object below the object Id.

other elements would sound similar to .Net object properties. Now click your content tab to see how it looks. It should be something like this

Just a side note : You might notice Calculate happens on each digit press, this makes sure you have a running total even before you hit the operator. The operator buttons will just store the current operator needed for your next digit press.