The Xamarin platform has been on the mobile development market for a long time. It is an open-source version of the .NET platform — Mono. This implementation includes its own C# compiler, execution environment and the main .NET libraries. The goal of Mono is to allow running programs written in C# on other operating systems than Windows — Unix-like or Mac OS.
Xamarin developers did a good job creating C# compilers for other platforms as well. Xamarin allows developers to use the .NET platform for creating mobile applications using C#, and it provides a full set of native API for using all of the capabilities of the mobile platform for which the app is made. In effect, the C# code is compiled into a native execution file that is exactly the same as if it were written in Java or Objective-C.
Xamarin grants developers the ability to build applications for Android, iOS, and Windows using C# in the same IDE: Xamarin Studio or even MS Visual Studio. This ability really makes cross-platform development easier. Using Xamarin, developers don't need to duplicate the business logic in their projects for each platform, resulting in up to 40% time saved on cross-platform development.
When Xamarin was first released, it was not the perfect solution to solving cross-platform development obstacles. First of all, learning the native library classes for each platform took time and it was completely crucial since Xamarin only provided a wrapping to the native API, but did not provide its own API. The second challenge was the necessity of buying an Apple computer for iOS development. Finally, the initial free version of the technology featured a very limited and unstable debugger. This free license limitation obstructed applying knowledge to real projects; there was no way to tell whether the full version would be the right tool for the job when it really mattered.
Thankfully, the situation changed with the time. Every new version improved platform stability and added new sets of useful features. In June 2014 a new library was announced: Xamarin.Forms. Xamarin.Forms provided the mechanisms required for building native iOS, Android and Windows user interfaces on the same C# codebase, using more than 40 cross-platform control elements and schemes which were connected to the native elements while the application runs. The resulting apps are now cleaner, and fit better within vendor guidelines.
To build a similar layout for different platforms is easy with Xamarin. The developer only needs to describe the interface with a markup language XAML, and after that, the library generates all of the necessary code. XAML is a language well-known by developers who have had experience with WPF (Windows Presentation Foundation). Xamarin.Forms, which utilizes XAML, can save a lot of time while developing a common interface with non-platform specific controls.
In February 2016, Microsoft company officially announced the purchase of the Xamarin technology, which by that time had grown to be one of the largest mobile development platforms. The details of the deal are unknown, but it is rumored to have sold for over $400 million. Two months later, in April 2016, Microsoft made many developers' dreams come true by making Xamarin a free product and adding it to the Visual Studio 2015 Community Edition. Additionally, Microsoft has revealed the source code of Xamarin SDK and it officially became an open-source project. Everyone can now contribute to the project, propose some fixes, or create additional features.
Microsoft’s involvement in the Xamarin project has skyrocketed the value of the platform relative to similar software. Experts are sure that more and more developers will use Xamarin, increasing its popularity and trustworthiness within the development community.
Xamarin is not a complete, universal solution, though it is an agile and powerful tool. There are cases when it is better to avoid using Xamarin; it is better NOT to use a cross-platform development approach when:
- The project was made for one platform and it is about to be converted to other popular platforms; or
- The project will likely utilize platform specific features or platform-dependent modules.
Xamarin has eliminated many of its major disadvantages, and is completely ready for being applied in real projects. Xamarin should become a required tool mobile developers to learn apply.
This article was written by Senior Tizbi developer, Andre