Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
When considering iOS or Android app development, most of us think about Objective-C vs Swift, and Java first of all. Being considered native tech stacks, they are naturally most often used mobile development tools when it comes to iOS and Android app development. However, there are more ways to build performant and user-friendly mobile apps. And Xamarin is one of them. In this article, we conduct an in-depth Xamarin review and compare it to native and cross-platform mobile development solutions on the market. If you know the basics, consider skipping to the sections you are interested in.
- What is Xamarin?
- Pros of using Xamarin
- Cons of using Xamarin
- Xamarin Visual Studio IDE
- Xamarin vs Native iOS/Android vs Hybrid Development
- Piece of advice
What Is Xamarin?
Itâs impossible to ignore Xamarin when talking about the key approaches to mobile application development. Xamarin is a tool used for cross-platform mobile app development that allows engineers to share about 90 percent of code across major platforms. Being a comparatively new tool, it is based on the Microsoft technology stack and already has a community of over 1.4 million developers.
The platform was built by the developers behind Mono, an open source development platform based on the .NET Framework, led by Miguel de Icaza and first introduced in 2001. The Xamarin company was founded on May 16, 2011.
However, unlike its predecessor, Xamarin was created as a commercial project until the company was acquired by Microsoft in 2016. Xamarin became a popular cross-platform product for developing mobile apps within the Microsoft ecosystem. This acquisition broke the financial barrier for using Xamarin. As Microsoft made Xamarin SDK open-source, it became part of Xamarin Visual Studio Integrated Development Environment (we discuss best IDEs to use for Xamarin development below). What are the main features of Xamarin?
C# language. Xamarin uses a single language, C#, to create apps for all mobile platforms. Unlike interpreted solutions, such as Appcelerator Titanium, Xamarin is natively compiled, which makes it a go-to option for building high-performance apps with native look and feel.
Based on .NET framework. C# is a mature language with strong safety-typing that prevents code from unexpected behavior. As C# is one of the .NET framework languages, it can be used with a number of useful .NET features such as Lambdas, LINQ, and Asynchronous programming (Asynk).
Technically speaking, Xamarin uses C# and native libraries wrapped in the .Net layer for cross-platform app development. Such applications are often compared to native for both iOS and Android mobile development platforms in terms of performance and user experience. Additionally, Xamarin can leverage all native and the latest API access to utilize underlying platform capabilities in Xamarin apps such as ARKit on iOS or Android Multi-Window.
While the code related to business logic, database access, and network communication can be shared across all platforms, Xamarin allows you to create platform-specific UI code layer. Thus, Xamarin cross-platform apps look 100% native on any device, providing better user experience, as compared to generic hybrid apps.
Compilation. The platform has two major products: Xamarin.iOS and Xamarin.Android. In the case of iOS, the source code is compiled directly into native ARM assembly code (Ahead-of-Time compilation), while Android Xamarin apps are first compiled down to Intermediate Language and thenâââinto native assembly code at runtime (Just-in-Time compilation). However, in both cases the process is automated and tailored to handle such issues as memory allocation, garbage collection, and platform interoperability by default.
Xamarin.Forms. Xamarin.Forms is a separate product designed to create prototypes or simple mobile apps sharing 100 percent of the code across iOS and Android.
Xamarin.Mac. Additionally, engineers can use Xamarin.Mac to build applications for Mac OS. These and some other products from the Xamarin stack will be discussed in a bit.
Platform SDKs. Xamarin provides access to platform-specific SDKs (CocoaTouch for iOS and Android SDK) via simple C#Â syntax.
Platform-specific code bindings. In most cases engineers will be able to handle development keeping the native look and feel of the respective platforms within the Xamarin environment. However, Xamarin allows you to call existing platform code (e.g. Swift for iOS) if you must reuse some modules or realize some platform-specific functions like barcode scanning, PayPal or Google Analytics integration.
Support of wearables. Xamarin supports building apps for Apple and Android Watch devices. Engineers can use Visual Studio both for Mac and Windows to build iOS Apple Watch apps. Also, Xamarin fully supports Android Wear.
Xamarin project structure. Most of the Xamarin-related work is expected to be run via a Windows development computer with Visual Studio and Xamarin installed. The apps can be debugged straight from the desktop or on devices and emulators. If you plan to develop iOS apps on Windows, itâs also possible as Visual Studio connects to the iOS storyboard designer and iOS simulator. Thereâs also Visual Studio for Mac which allows for running a simulator on the Mac or directly on a tethered iPhone. Debugging is run via Visual Studio.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.