Xamarin is a platform that enables developers to create cross-platform applications on Android, iOS, Window, and other platforms, by using the same source code and the same integrated development environment (IDE).
You're reading from Mobile DevOps
History of Xamarin
Xamarin was started as an experiment to try and develop a version of .NET for Linux in early 2000, and was first known as an open source project called Mono.
Later, the same project was developed and supported by a new company called Xamarin, which was created by the very first developers of Mono, and was also known as MonoTouch and Mono for Android.
Development of Mono continued and it was later renamed Xamarin, which supported Android and iOS app development.
Xamarin has now been acquired by Microsoft and is developed and supported as one of the products offered by Microsoft with great integration with the existing IDE, Visual Studio, and it even has its own IDE, called Xamarin Studio, which is available for both Mac and Windows.
Why you should learn Xamarin
Well, there are many scenarios where Xamarin can save the day, and in some cases literally months.
Let's say you have an idea for a mobile application that you want to develop. Of course, you want it to be developed soon and get it to market. But there are some small challenges and decisions that you should overcome or decide on before you dive into your development process.
Let's have a look at those challenges:
- Choose mobile platforms to target: This is a very important part in the planning phase of our application. The mobile platform market is divided into major players, such as Android, iOS, and Windows. To get the most out of our application, we will want it to be accessible and available to the majority of users out there.
- Learn a platform-specific coding language or have platform-specific developers in your team: Now, let's...
Installing Visual Studio and Xamarin on Windows
To install Visual Studio and Xamarin on a Windows machine, follow these steps:
- Go to https://www.visualstudio.com/downloads/.
- When you open the preceding URL in a browser, you'll get a screen like this:
- You can see there are several editions of Visual Studio available for developers.
- You can choose the version best suited to your requirements. If you just want to learn Xamarin using Visual Studio, or if you are an individual developer looking for a free version, then Visual Studio Community Edition is best suited for you.
- Click on Free download provided under Visual Studio Community 2017.
- You should get a Visual Studio installer file downloaded on your computer.
- Open the installer file and you should see a screen like this:
- Click on the Continue button to begin the installation process.
- It can take some time to load the...
Setting up our Android Virtual Device for development
Android Emulator will enable us to test our Android application on a computer and we will not require an actual device to test.
- Let's click on Tools | Android | Android Emulator Manager:
- To make this process easier and simpler, we'll start with the existing mobile templates available for Android Emulator.
- Go to the Device Definitions tab shown in the following screen. Once you reach the Device Definitions screen, scroll down until you see Nexus devices in the list:
- Select the Nexus device of your choice and click on the Create AVD button on the right-hand side.
- Next, you should get a window such as the following, where you can customize your Android Emulator to your requirements:
- Fill in all the required details. You can refer to the preceding screenshot for help. Once you click OK, AVD Manager will create...
Summary
In this chapter, we learned about the brief history of Xamarin and why it's a great tool for developers looking for cross-platform mobile app development.
We also learned how to install Visual Studio and Xamarin on a Windows machine, along with how to create an AVD for testing our app.
In the next chapter, we will learn about basic application fundamentals and create our first Android application using Xamarin.