Xamarin - Mobile App Framework

Xamarin - Mobile App Framework

Xamarin has eventually turned a popular cross-platform mobile app development framework. Based on the concept of Write once, Run anywhere (WORA), Xamarin has become a preferred framework for iOS, Android and Windows app development.

The cross-platform mobile app development trend is growing day by day and Xamarin is emerging as one of the ways to get to it interactively. Xamarin is based on C# programming technology and can be used in the cross-platform mobile app development for Android, iOS and Windows. Xamarin apps are built with native UI and APIs to deliver better performance. These apps share single codebase across all platforms. There are a number of benefits of using Xamarin framework such as 90% of code can be reused which means there is little work required to do when it comes to launching an app on multiple platforms. It now has support for Portable Class Libraries which aids developer to rapidly code an app.

The framework comes with Xamarin.Forms which lets developers use portable control subsets that are mapped to native control of iOS, Android and Windows Phone. Also, Xamarin has better security features to storing data, particularly enterprise data.

Pros  and Cons:

One Technology Stack to Code for All Platforms

Xamarin uses C# complemented with .Net framework to create apps for any mobile platform. Thus, you can reuse up to 96 percent of the source code speeding up the engineering cycle. Xamarin also does not require switching between the development environments: You can build all of your Xamarin apps in Visual Studio which completely replaced Xamarin Studio. The cross-platform development tools are provided as a built-in part of the IDE at no additional cost.

Performance Close to Native

Unlike traditional hybrid solutions, based on the web technologies, a cross-platform app built with Xamarin, can still be classified as native. The performance metrics are comparable to those of Java for Android (as explained here) and Objective-C or Swift for native iOS app development. Moreover, Xamarin performance is constantly being improved to fully match the standards of native development. Visual Studio offers a complete solution for building, testing, and tracking the app’s performance: Visual Studio App Center allows you to run automated UI tests and identify performance issues before the release. However, this service is provided at an additional fee.

Native User Experiences

Xamarin allows you to create flawless experiences using platform-specific UI elements. Simple cross-platform apps for iOS, Android or Windows are built using Xamarin.Forms tool, which converts app UI components into the platform-specific interface elements at runtime. As the use of Xamarin.Forms significantly increases the speed of app development, it is a great option for business-oriented projects. Yet, there might be a slight decline in performance due to the extra abstraction layer. For custom app UI and higher performance you can still use Xamarin.iOS and Xamarin.Android separately to ensure excellent results.

Full Hardware Support

With Xamarin, your solution gets native-level app functionality. It eliminates all hardware compatibility issues, using plugins and specific APIs, to work with common devices functionality across the platforms. Along with the access to platform-specific APIs, Xamarin supports linking with native libraries. This allows for better customization and native-level functionality with little overhead.

Open Source Technology with Strong Corporate Support

After the company was acquired by Microsoft in February 2016, Xamarin licensing policies underwent radical changes. Xamarin SDK, including runtime, libraries, and command line tools, has become open source and available for all under the MIT license as a part of Visual Studio. By eliminating the major barrier, the cost of license, Microsoft paved the way for the further growth of the platform. Plus, headed by Microsoft, and supported by Unity, JetBrains, and Red Hat, the .NET Foundation in general and Xamarin specifically has become a reliable and powerful tech stack.

Simplified Maintenance

Due to its cross-platform application, Xamarin makes maintenance and updates easier. You can simply deploy the changes or updates to the source file and they will be applied to both iOS and Android apps. However, this works only for the applications that use Xamarin.Forms or the business logic, shared code, updates for Xamarin.iOS and Xamarin.Android apps. Thus, it helps you save your time and money while keeping your apps up to date.

Complete Development Ecosystem

Xamarin comes in one package with a complete development toolset, including its own IDE (Xamarin Studio that is now replaced by Visual Studio), the platforms itself (Xamarin SDKs), testing (Xamarin Test Cloud), distribution and analytics (Hockeyapp and Xamarin.Insights) platforms. Thus, you don’t need to invest in additional tools or integrate the third-party apps to build, test and deploy your Xamarin apps.

Xamarin.Forms: a framework for simple apps and prototypes

Xamarin suggests developers build mobile apps in two ways. The first one is to use Xamarin.iOS and Xamarin.Android, which is considered the main approach. Using Xamarin.Forms, the Visual Studio Library is the second one. Xamarin.Forms allows for rapid prototyping or producing apps with less platform-specific functionality. That’s why Xamarin.Forms is the best fit for apps where code sharing is more important than custom UI. You’ll be able to create a single interface and share it across platforms without designing for each platform individually. You can also build applications where some parts of their user interfaces are made with Xamarin.Forms and the others are engineered using the native UI toolkit.

While Xamarin.Forms remains a compromise in terms of native look and feel compared to Xamarin.iOS and Xamarin.Android, there’s a vibrant community paying attention to this tool. For instance, some tech providers contribute their libraries like Telerik UI that enrich engineering capabilities providing pre-configured UI components.

Xamarin.Forms Live Player

As Xamarin.Forms is aimed at fast and frictionless development, Microsoft suggests using a Live Player tool. It’s an application installed on actual phones to immediately test and debug your apps without emulator deployment or tethering a device to a workstation. Upon Live Player installation a developer scans a QR-code in Visual Studio using a phone camera, which provides access to a currently developed app. An app on the phone synchronizes in real time with the one in Visual Studio. This drastically simplifies all set up and further debugging procedures. Unfortunately, Microsoft discontinued Live Player support, but you still can download the app and and pair it with Visual Studio.

Building apps for Macs with Xamarin.Mac Tool

Xamarin.Mac allows for developing fully native Mac apps using C# and .NET. It integrates with the same libraries that are used for developing in Objective-C with Xcode. By using Xamarin.Mac combined with Xamarin.iOS and Xamarin.Android, developers can share up to 90 percent of native code across Android, iOS, and Mac OS. Furthermore, Xamarin.Mac integrates with Xcode, so a developer can use the Xcode’s Interface Builder to create an app’s user interfaces.

Slightly Delayed Support for the Latest Platform Updates

This depends completely on the Xamarin developer team. It’s impossible for third-party tools to provide the immediate support for the latest iOS and Android releases: it takes some time to implement the changes and/or introduce new plugins, etc. Although Xamarin claims to provide same-day support, there still might be some delays.

Limited Access to Open Source Libraries

Native development makes extensive use of open source technologies. With Xamarin, you have to use only the components provided by the platform and some .Net open source resources, facing both developers and consumers. While the choice is not quite as rich as it is for Android and iOS mobile app development, the Xamarin Components provide thousands of custom UI controls, various charts, graphs, themes, and other powerful features that can be added to an app in just a few clicks. This includes built-in payment processing (such as Stripe), Beacons and wearables integration, out of the box push notification services, cloud storage solutions, multimedia streaming capabilities and much more.

Xamarin Ecosystem Problems

Obviously, Xamarin community is significantly smaller than those of iOS or Android. Thus, finding an experienced Xamarin developer could be a challenge. Although the platform is growing its following fueled by the support from Microsoft. Based on the info from different sources, Xamarin community makes 10 percent of the global mobile development society. Despite the fact that the number of Xamarin engineers does not compare to iOS or Android native communities, the platform provides extensive support to its developers. Namely, there is a dedicated educational platform, Xamarin University, that provides resources and practical training for those who are new to this technology. Using this support, the learning curve for an experienced C#/.Net engineer is minimal.