Introduction To Xamarin.Android Using C# - Part One

Introduction
 
What Is Xamarin
 
Xamarin.Android will create native Android applications using modern language (C#), .NET Base Class Library Visual Studio. Xamarin is a cross-platform development tool. It solves dilemmas many developers face when developing cross-platform apps: separate coding languages and UI paradigms. With Xamarin, you can use C# for iOS, Android, and Universal Windows apps. And with Xamarin Forms, interface design for all three platforms can be accomplished within its XAML-based framework.
 
History Of Xamarin
 
Xamarin 2.0 was released in February 2013 . Xamarin.Android and Xamarin.iOS make it possible to do native Android, iOS and Windows development in C#, with either Visual Studio or Xamarin Studio. Developers re-use their existing C# code, and share significant code across device platforms. The product was used to make apps for several well-known companies. 
 
Xamarin supplies add-ins to Microsoft Visual Studio that allows developers to build Android, iOS, and Windows apps within the IDE using. Xamarin for Visual Studio also has extensions within Microsoft Visual Studio that provide support for the building, deploying, and debugging of apps on a simulator or a device.
 
Xamarin With Microsoft Partenership
 
In late 2013, Xamarin and Microsoft announced a partnership that included customer programs to make it possible for their joint developer bases to build for all mobile platforms. In addition, Xamarin now includes support for Microsoft Portable Class Libraries and most C# 5.0 features such as async/await. CEO and co-founder of Xamarin, Nat Friedman, announced the alliance at the launch of Visual Studio 2013 in New York. 
 
Visual Studio Community
 
On 2016 Microsoft announced that they were merging all of Xamarin's software with every version of Microsoft Visual Studio including Visual Studio Community, and this added various Xamarin features to come pre-installed in Visual Studio such as an iOS emulator. 
 
Owner Of Xamarin
 
Xamarin is a Microsoft-owned software company founded in May 2011.  Deliver even more amazing apps with Xamarin and Microsoft.
The combination of Xamarin, Visual Studio, Visual Studio Team Services, and Azure provides a complete mobile app dev solution that provides everything you need to develop, test, deliver and instrument mobile apps for every device.
 
Xamarin
 
Xamarin has more than 15,000 customers in 120 countries. Through Xamarin Test Cloud, all types of mobile developers—C#,Objective-C, Java and hybrid app builders —can also test and improve the quality of apps using thousands of cloud-hosted phones and devices. 
 
Types of Xamarin approaches
 
Here are two application developments in the Xamarin approach and those are Xamarin traditional application development and Cross platform mobile application development.
 
Cross Platform Mobile Application Development

This application development is the same as Xamarin Traditional Application Development, the only difference is we don’t require separate technology to develop UI based on the platform. We can use Xamrin.Forms to develop UI for all platforms (Android, iOS, and Windows). Xamarin.Forms can be shared across Android, iOS, and Windows phones.
 
Xamarin Tradition Application Development

In this Xamarin application development, we use the same technology (C#) for business logic development and different technology to develop UI based on the platform. We use Xamarin.Android for Android UI development, Xamarin.iOS for iOS UI development. Xamarin traditional application development will not support to develop UI for windows, but we can call this business logic from UWP (Universal Windows Platform). The main advantage of this application development is we can share business logic code across all multiple platforms. That means if we did any change in business logic will affect on multiple platforms. The main disadvantage with this application development is, we still need to use multiple technologies to develop UI based on the platform.
 
Note
 
Xamarin approach is the best way for mobile application development among Silo approach, Black Box approach.
 
Steps For Installation process
 
Step 1
 
Download the Xamarin unified installer.
 
 
You will be asked the option of downloading either Visual Studio Community Edition (if you don't have Visual Studio installed), or
Xamarin for Visual Studio, via the Xamarin Unified Installer.
 
Step 2
 
Run the Xamarin Installer.
 
Step 3
 
Visual Studio Community installer will start downloading and uploading files.
 
Step 4
 
The installer will assess your system, and allow you to select optional components. Make sure to select Xamarin from the menu when prompted.
 
Step 5
 
The first step in the installation requires you to review and accept the license in order to proceed. To do this, click the checkbox and press Next:
 
Step 6
 
Next, the installer will inspect the system to determine which, if any, required components are missing and need to be downloaded and installed. You can select which products you wish to download here:
 
After identifying missing components, the Xamarin installer will download and execute the installers for the platform dependencies.
 
Step 7
 
The Xamarin unified installer will start the download and install process of the selected items. When the installation is complete, close this window to exit the installer and begin working with Xamarin.
 
Step 8 SetUp the Installation
 
Now that we’ve installed the components, we might need to tell our IDE where to find them. Visual Studio has configuration options that let us specify the Java and Android SDK locations.During installation, the installer places the components in their default locations and configures the development environment with the appropriate path configuration. For most users the default locations will
work without further changes in these screens.However, if they're already installed or if they are in locations other than the default, then the the following screens should be used to specify the paths to these components.
 
To configure the Visual Studio tools, navigate to Tools > Options > Xamarin > Android Settings,
 
Step 9 User Activation
 
Only applicable if you have a valid Xamarin license and you want to continue to use it. If you have a Professional or Enterprise MSDN subscription, ensure that you have logged in to Visual Studio.Logging in with your MSDN subscription will allow you access to the full suite of Xamarin Products.Alternatively, you can also take advantage of the Visual Studio Community Edition, which will allow you to develop with Xamarin for free.
 
Step 10 Purchase license
 
If you've already purchased your Xamarin products, browse to Tools > Xamarin Account… and log in with
your Xamarin credentials.
 
Got to XAMARIN SOFTWARE LICENSE TERMS
 
 
Step 11
 
Now that we’ve installed the components, we can launch our IDE of choice and create a new solution. For example, to create a new application in Visual Studio we would choose New Project... from the Visual Studio Welcome Screen and select Android > Android Application in the New Solution dialog. Choose anapplication name and click OK.
 
After Installation check the installed Softwares,
 
For Xamarin Studio
 
Xamarin
 
For Visual Studio Community Edition
 
Xamarin
 
Oracle VM VirtualBox

Oracle VM VirtualBox is a free and open-source hypervisor for x86 computers currently being developed by Oracle Corporation. The world’s most popular cross-platform virtualization software enables you to run multiple operating systems on your Mac, PC, Linux, or Oracle Solaris machine.It is used to Test, Develop, and Demonstrate Across Multiple Platforms on one Machine.
 
Xamarin
 
Xamarin Android Player
 
It also tightly integrates with Visual Studio and Xamarin Studio, so that developers can build, deploy, and debug their apps right from their favorite IDE. Additionally, you can run the Xamarin Android Player side-by-side with the Windows Phone Hyper-V emulator without any conflicts for a great development experience on Windows.
 
The Xamarin Android Player runs Android x86 virtual machines using hardware accelerated virtualization technology and is available on both Windows and Mac OS X. It supports OpenGL.
 
Use of Xamarin Android Player Over Android Emuator 
 
Android emulators are slow to boot and perform poorly. So it was struggling with slow emulators, so Xamarin Android Player for fast performance and boot is introduced at Xamarin Evolve 2014. 
 
Pic-1
 
Xamarin
 
Pic-2
 
Xamarin
 
Open Graphics Library (OpenGL)
 
OpenGL is platform independent, rather than cross platform. It is just a specification for the interface of a graphics library. OPENGL REQUIRES WINDOWS FIREWALL PUBLIC NETWORK TO OPEN OR RUN ANDROID DEVICE.
 
Module Summary
  • What is Xamarin.
  • History Of Xamarin.
  • Installation process of Xamarin for Windows.
  • Details of Softwares installed  in system.