Start new Xamarin project

This is an example how to start new Xamarin project cross platform solution. First thing to do is to start in Xamarin studio with File→New→Solution.

snp01

Then we choose other blank solution: Other→Blank Solution

snp02

Now, we need to add new project to current solution: Add→Add New Project

snp03

In New Project Dialog choose C#→Android→Android Application and name project StatCalc.

snp04

In order to access to graphic layout of Xamarin C# application, we need to unfold:
Resources→layout→Main.axml and then make double click on it (Main.axml)

snp05

Then, on the right hand side of the screen we can find Toolbox tab. We need to click on it to have access to UI controls.

snp06

To start writing code, we need to double click on MainActivity.cs

snp07

Then we can remove default button and corresponding code.

namespace StatCalc
{

[Activity (Label = “StatCalc”, MainLauncher = true, Icon = “@drawable/icon”)]

public class MainActivity : Activity

{

//int count = 1;

protected override void OnCreate (Bundle bundle)

{

base.OnCreate (bundle);

// Set our view from the “main” layout resource

SetContentView (Resource.Layout.Main);

// Get our button from the layout resource,

// and attach an event to it

//Button button = FindViewById<Button> (Resource.Id.myButton);

//button.Click += delegate {

//button.Text = string.Format (“{0} clicks!”, count++);

//};

}

}

}

External links:

How to start new Xamarin project on developer.xamarin.com
How to start new Xamarin project on code.tutsplus.com
How to start new Xamarin project on rcrwireless

Posted in xamarin

Leave a Reply

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

*