Taken to develop applications for iOS and Android, most of them consider recognized native stacks of technologies, such as Objective-C, Swift and Java, as development tools. However, there are many other ways to create efficient and easy-to-use mobile applications. The Xamarin application development platform is one of them. In this article we will conduct an in-depth review of the Xamarin platform in comparison with the native and cross-platform solutions for mobile development in the market.
What is Xamarin?
When it comes to key mobile application development tools, Xamarin cannot be ignored. Xamarin is a relatively new tool based on the principles of Microsoft technology. But today there are already over 1.4 million developers in his community.
The Xamarin platform was created by the developers of the open platform Mono, which was in the free implementation of .NET, which was first introduced in 2001. Nevertheless, unlike its predecessor, Xamarin existed exclusively as a commercial project until the company was acquired by Microsoft.
')
Xamarin is a special tool, as it uses a single C # language to create applications for all mobile platforms.
Unlike language-insensitive development solutions, such as Appcelerator Titanium, the Xamarin platform allows you to build native assemblies for target platforms and create high-performance applications with a natural appearance. From a technical point of view, for cross-platform development, Xamarin uses a single C # language and libraries wrapped in a .NET layer. From the point of view of work and user experience, such applications can be attributed to native, that is, specially designed for iOS and Android.
Although the code associated with business logic, database access and network communications can be used on all platforms, Xamarin allows you to create a layer of UI code for a specific platform. Thus, Xamarin cross-platform applications look 100% native on any device, providing the best user experience compared to standard hybrid applications.
The platform has two main forms: Xamarin.iOS and Xamarin.Android. In the case of iOS, the source code is compiled directly into the native assembler code ARM (AOT compilation), while Android Xamarin applications are first compiled into intermediate universal code, and then into native code at runtime (JIT compilation). Nevertheless, this approach is not the solution to all problems. Like any other technology, Xamarin has its advantages and disadvantages, which have recently become the subject of heated debate.
Advantages of using Xamarin for mobile app development
There are several good reasons why Xamarin is used by many companies, including Trello, Slack and GitHub.
+ Unified technology stack for development on all platforms
Xamarin uses the C # language and the .NET Framework to create applications for any mobile platform. Thus, you can reuse up to 30% of the source code, speeding up the development process. Xamarin also does not require switching between development environments: all Xamarin applications can be created using Visual Studio. Cross-platform development tools are provided as an integrated part of the IDE at no additional cost.
+ Productivity is close to native
Cross-platform application created using Xamarin can be classified as native, unlike traditional hybrid solutions based on web technologies. Performance metrics are comparable to Java for Android and Objective-C or Swift for developing iOS applications. Moreover, the performance indicators of Xamarin are constantly being improved and improved to fully comply with the standards of domestic development. The Xamarin platform offers a comprehensive solution to test and monitor application performance: The Xamarin Test Cloud, in conjunction with the Xamarin Test Recorder, allows you to run automated user interface tests and find performance problems before the application is released. However, this service is available at an additional cost.
+ Native UI
Using platform-specific UI elements, Xamarin allows you to create an interface. For greater convenience of developing the user interface of the application, it is recommended to use Xamarin.iOS and Xamarin.Android separately. It provides the best result.
+ Equipment compatibility
Xamarin addresses all hardware compatibility issues using plug-ins and various APIs for working with common device features on all platforms. Along with access to specific API platforms, Xamarin can be bundled with native libraries for a particular platform. This allows for more fine-tuning and maintaining the functionality of the layer native to the platform with little overhead.
+ Open Source-technology with corporate support
After Microsoft acquired the company in February 2016, Xamarin’s licensing policy underwent a radical change. The Xamarin SDK, including libraries and command-line tools, has become open and accessible to everyone under the MIT license, as part of Visual Studio. By removing the main obstacle in the form of a license cost, Microsoft has provided the best conditions for the further development of the platform. In addition, led by Microsoft and supported by Unity, JetBrains, Red Hat, the .NET Foundation, Xamarin has become a reliable and powerful technology stack for developing mobile applications.
+ Simple support
Thanks to cross-platform, Xamarin simplifies support and software updates. You can simply make changes to one source file, and they will be applied to both iOS and Android applications. But this is only related to applications that use common business logic, as well as common code for Xamarin.iOS and Xamarin.Android applications. Thus, it will help you save time and money, while maintaining your applications in working condition.
+ Full development toolkit
Xamarin is delivered in one package with a full package of development tools: own IDE system (Visual Studio), Xamarin SDK, testing (Xamarin Test Cloud), distribution and analytics (Hockeyapp and Xamarin.Insights). Thus, you do not need to invest in additional tools or integrate other applications to create, test and deploy your Xamarin applications.
Xamarin Features
Cons when developing on Xamarin
- Delays in platform updates
It depends entirely on the Xamarin development team. It’s impossible for third-party tools to provide immediate support for the release of the latest iOS and Android updates: it takes some time to implement new changes, new plug-ins, etc. Although Xamarin claims to provide support on the same day, it can still be delays in one to two days.
- Limited access to open-source libraries
Native development makes extensive use of open source technology. With Xamarin, you’ll have to use the components provided by the platform and some .NET resources that are used by developers and consumers. The choice, of course, is not as great as when developing mobile applications for iOS and Android, however, Xamarin components provide thousands of different interface elements: diagrams and graphs, themes, and other convenient and useful functions that can be added to any application in just a few clicks. . This platform includes built-in payment processing features (such as Stripe), support for beacons and wearable devices, Push notification services, cloud storage solutions, multimedia capabilities, streaming and much more.
- Ecosystem constraints
Although the Xamarin platform is growing and developing, and is also supported by Microsoft, but it is obvious that the community of experts who understand the specifics of Xamarin is much smaller than iOS or Android, so finding an experienced developer can be difficult. Based on information from various sources, the Xamarin community accounts for 10% of the total number of mobile developers. Despite the fact that the number of Xamarin engineers does not compare with the number of iOS or Android professionals, the platform creators support their specialists. For example, there is a special educational institution Xamarin University, which provides a variety of resources and opportunities for practical training of specialists in this industry. Thanks to this support, the learning curve is minimal for experienced C # programmers.
- Requirements for basic programming language knowledge
When using Xamarin.iOS and Xamarin.Android, in order to create mobile applications with a native interface, you have to write a platform-dependent code layer. Therefore, at least basic knowledge of native technologies is required (Java / Kotlin for Android and Objective-C / Swift for iOS). However, they do not apply to Xamarin.Forms.
- Xamarin is not suitable for high performance graphics applications.
The main advantage of Xamarin is the ability to use code on different platforms. However, this is only about logic, the UI code will be basically unique to the platform. This allows you to create games on Xamarin, but a rich user interface or complex animations with a small amount of common code make Xamarin unusable.
- Larger application size
Depending on the type and complexity, Xamarin applications are usually larger than native ones, sometimes even twice. On Android, a simple “Hello, World” can take up to 16 MB, with most of it being used by linked libraries, the Mono environment, and the base libraries (Base Class Library, BCL). Thus, an application usually needs additional optimization so that its file size is not too large.
Features of application development on Xamarin
- Difficulties with integration
There are chances that some problems may arise with the integration of third-party resources with Xamarin. Although most tools and libraries offer full support for native technologies, compatibility with Xamarin cannot be guaranteed by the manufacturer. Although Xamarin has its own arsenal of components, there is always the possibility that you may need a specific function or integration in your application that is not provided by the platform.
Recently, many application developers tend to agree that Xamarin can be considered a native development tool. In fact, there is the view that "everything that can be done in an iOS application using Objective-C or Swift, and everything that can be done in an Android application using Java, can be done in C # using Xamarin."
A source