Xamarin's development tools have given us the power to develop native iOS, Android, and Mac applications in C#, which is one of the most popular programming languages. There are many advantages of choosing Xamarin to develop mobile applications instead of Java and Objective-C. You can share code between both the platforms and can be more productive by taking advantage of the advanced language features of C# and the .NET base class libraries. Alternatively, you would have to write the app twice for Android and iOS and lose the benefits of garbage collection when using Objective-C.
In comparison to other techniques of developing cross-platform applications with JavaScript and HTML, Xamarin also has some distinct advantages. C# is generally more performant than JavaScript, and Xamarin gives developers direct access to the native APIs on each platform. This allows Xamarin applications to have a native look and perform in a manner similar to their Java or Objective-C counterparts.
Xamarin's tooling works by compiling your C# into a native ARM executable that can be packaged as an iOS or Android application. It bundles a stripped-down version of the Mono runtime with your application that only includes the features of the base class libraries your app uses.
In this chapter, we'll set up everything you need to get started on developing with Xamarin. By the end of this chapter, we'll have all the proper SDKs and tools installed and all the developer accounts needed for app store submission.
In this chapter, we will cover:
Xamarin has developed three core products for developing cross-platform applications: Xamarin Studio (formerly MonoDevelop), Xamarin.iOS (formerly MonoTouch), and Xamarin.Android (formerly Mono for Android). These tools allow developers to leverage the native libraries on iOS and Android and are built on the Mono runtime.
Mono, an open source implementation of C# and the .NET framework, was originally developed by Novell to be used on Linux operating systems. Since iOS and Android are similarly based on Linux, Novell was able to develop MonoTouch and Mono for Android as products to target the new mobile platforms. Shortly after their release, another company acquired Novell, and the Mono team left to form a new company. Very shortly after, Xamarin was founded to focus completely on these tools for developing with C# on iOS and Android.
Getting a development machine ready for cross-platform application development can take some time. And to make matters worse, Apple and Google both have their own requirements for development on their respective platforms. Let's go over what needs to be installed on your machine.
To get started on iOS, we'll need to install the following:
Android also requires the following software to be installed to get started:
Each of these will take some time to download and install. If you can access a fast Internet connection, it will help speed up the installation and setup process. With everything ready to go, let's move ahead step-by-step, and hopefully, we can skip a few dead-ends you might otherwise run into.
It is important to note that Xamarin can also be used on Windows and Visual Studio, even though it is not covered in this book. A Mac is required for iOS development, so Windows developers must connect Visual Studio to a Mac to compile for iOS. Luckily, most of what we learn in this book can be directly applied to using Xamarin on Windows.
18.118.142.166