Introduction

In this article, you will learn some basic concepts of Xamarin. And also, you will learn about things that someone needs to learn Xamarin from the beginning. This is why it is called a starter pack for beginners.

What you’ll learn

What is Xamarin?

Background

Xamarin is a software company founded on May 16, 2011; Microsoft signed an agreement to acquire Xamarin on February 24, 2016.

Name

The name Xamarin comes from the name of a Tamarin Monkey, and replaces the leading T with an X (Cross).

Definition

Xamarin is an application development platform that lets you build applications for many platforms with a single shared code base.

Installation Guide

Note

For iOS development with Visual Studio on Windows, you also need to set up a Mac with the Xamarin tools.

Supported operating systems for Xamarin tools.

Advantages of Xamarin

Development Approaches

There are two main development approaches used to develop a xamarin app. These approaches are:

  1. Separate UI Approach
  2. Shared UI Approach

In shared UI approach all of your code is shared in all platforms. This code includes sharing of business logic and sharing of UI. That means in this approach you have to develop only one UI for all the platforms and it is shared in all the projects. In this approach all of your code is shared expect some of code that includes connection to DB and some other things related to this.

In Seprate UI approach all of your business logic is shared but you have to develop seprate UI for all applications. This approach is used to make pixel perfect UI for all applications.

As shown in figure blow.

Xamarin

Application Lifecycle

Let’s discuss about application lifecycle of xamarin forms.

Create a xamarin forms PCL project if you are going to create your first project than visit this link . After creating the project go solution explorer here you will see App.xmal file expand the file and open App.xaml.cs.

Here you will see three main methods

On Start

On Start method calls when your application is started at first. When your application starts, it reads all the code written in On Start method.

On Sleep

On sleep method calls when your application goes to sleep. Sleep method calls when user hides the application. And, it is running in background, then all the code you write in sleep method is executed.

On Resume

This method calls when your application comes from On Sleep method that means when you restart the application after hiding it. Then all the code that is written in OnResume method is executed.

You can see the code working by adding some breakpoints in you applications. Add break points in all methods and see your working according to the behavior of application.

Common UI Controls

From now on, you learn to make a new Xamarin.Forms app. And have basic understanding about Xamarin.Forms and application lifecycle. Now, move toward some common UI controls that are used in our application.

There are four main groups of Xamarin.Forms UI.

Pages

Xamarin

Layouts
Xamarin

Useful Links

What’s next?

Read the links given above and you will get very useful information. I hope you get a good start by reading this.

Keep learning. Happy coding.