Xamarin is a Microsoft platform for creating mobile applications in C#, announced in 2011. According to Microsoft Xamarin Documentation, 2024, Xamarin allows you to write applications for iOS, Android and Windows with a shared codebase in C# and .NET, using Mono Runtime for compilation into native code. Since 2024, Xamarin.Forms has been replaced by .NET MAUI.
Key Takeaways
Xamarin is a platform based on .NET and Mono that allows you to use C# for creating cross-platform mobile applications. The company Xamarin was founded in 2011 and acquired by Microsoft in 2016 for $400 million. After the acquisition, Xamarin became part of the Visual Studio and Azure ecosystem.
Before the acquisition, Xamarin was a commercial product with an Enterprise license. Microsoft made it free as part of Visual Studio Community and also open-sourced the Mono Runtime and SDK bindings. This led to a surge in popularity: by 2020, Xamarin was used in 15% of cross-platform projects, according to a SlashData report.
The main idea of Xamarin is to split code into three layers: shared business logic (C#, .NET Standard), platform-specific projects (iOS, Android), and an optional shared UI via Xamarin.Forms. This approach allowed reusing up to 75% of code while maintaining native access to each platform's API.
The first version Xamarin 1.0 was released in 2012 with iOS support only. Android support was added in 2013. Xamarin.Forms — a declarative UI framework — was introduced in 2014 at the Evolve conference. Xamarin 4.0 (2016) included support for watchOS and tvOS. Xamarin 5.0 (2019) introduced CSS styles and Material Design theming.
The latest major version Xamarin.Forms 5.0 was released in 2021. Microsoft announced that Xamarin is entering support mode (end of life — May 1, 2024) and recommended migrating to .NET MAUI (Multi-platform App UI), which is part of .NET 6+. Xamarin.Forms 5.0 no longer receives new features, only critical security fixes.
Xamarin.Forms is a UI framework that abstracts the interface through a unified set of components. XAML markup (ContentPage, StackLayout, Label, Button) maps to native controls on each platform via renderers. Label translates to UILabel on iOS and TextView on Android. This approach provides up to 95% shared UI code.
Xamarin.Native (also Xamarin.iOS and Xamarin.Android) is an approach without a shared UI. The developer creates separate screens for iOS (Interface Builder or Storyboard) and Android (AXML), using a single C# backend. This gives full control over the look and feel of each platform but increases UI code duplication to 50–60%.
According to the Microsoft Developer Survey 2023, 70% of Xamarin projects used Xamarin.Forms, 20% used Xamarin.Native with shared services, and 10% used a hybrid approach with custom renderers for platform-specific optimizations.
Xamarin Architecture consists of two levels. The lower level is Mono Runtime, which executes C# IL (Intermediate Language) on the platform. The upper level consists of Managed Callable Wrappers (MCW) for iOS and Android Bindings for Android, which provide access to native APIs from managed C# code.
Mono is an open-source implementation of the .NET Framework. In Xamarin, Mono operates as the Common Language Runtime (CLR), loading C# assemblies and compiling them into machine code. On iOS, Mono compiles Ahead-of-Time (AOT) — into ARM64 machine code, as Apple prohibits JIT compilation in user applications. On Android, Mono uses JIT compilation with AOT profiling.
iOS Bindings (Xamarin.iOS) are C# wrappers over the Objective-C runtime. Each UIKit class (UIView, UIViewController) is represented by a managed class in the Xamarin.iOS.dll assembly. Objective-C Selectors are invoked through the MessageUI mechanism. On Android, Xamarin.Android uses Android Callable Wrappers (ACW) — a JNI bridge between C# and Java/Kotlin. Kotlin libraries are wrapped via the Android Bindings Library.
XAML (eXtensible Application Markup Language) is a declarative language for describing UI. In Xamarin.Forms, XAML defines the screen structure: pages (ContentPage), containers (StackLayout, Grid, FlexLayout), and elements (Label, Entry, Button, ListView). The C# code-behind handles events (Clicked, PropertyChanged) and manages data binding (Binding, Data Binding).
MVVM Pattern is the recommended architecture for Xamarin.Forms. The Model contains data, the ViewModel implements INotifyPropertyChanged and commands (ICommand), and the View (XAML) binds through BindingContext. Implementing ICommand via RelayCommand or Prism DelegateCommand enables testing ViewModel without UI dependencies. The Prism.Forms library provides NavigationService, DialogService, and modularity.
using Xamarin.Forms;
namespace XamarinApp
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var label = new Label
{
Text = "Hello, Xamarin!",
FontSize = 24,
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center
};
Content = new StackLayout
{
Children = { label }
};
}
}
}
Unified C# Language — the main advantage of Xamarin. C# and .NET developers can create mobile applications without learning Swift, Kotlin, or Objective-C. Business logic, networking, databases (SQLite via ORM), encryption, and logging are written once and reused across all platforms. This simplifies code maintenance and testing.
Access to Native APIs — Xamarin provides 100% access to iOS (Cocoa Touch) and Android (Android SDK) APIs through bindings. When a new version of iOS or Android is released, Microsoft publishes updated bindings within 24–48 hours. For missing bindings (custom Objective-C or Kotlin libraries), you create Android Bindings Library or iOS Binding Library manually.
Integration with Microsoft Ecosystem — Xamarin supports Visual Studio, Azure DevOps, App Center (CI/CD, testing, monitoring), and Enterprise Mobility + Security (Intune, ADAL, MSAL). App Center Analytics and Crashes collect data from live applications. Visual Studio App Center automates build, device testing, and publishing to app stores.
Disadvantages of Xamarin include application size — an empty-screen Xamarin.Forms APK weighs 25–35 MB compared to 5–8 MB for a native Android app. Compilation time is also higher: a medium-sized project builds in 2–5 minutes versus 30–60 seconds in native Android Studio. Mono Runtime adds 15–20 MB to the final binary.
The second drawback is new API delay. New iOS/Android features appear in native development immediately, while in Xamarin they arrive 1–2 months after binding releases. The iOS 17 SDK (2023) was fully supported by Xamarin 3 weeks after release. For urgent projects, this can be critical. .NET MAUI solves this problem through direct integration with .NET 8.
| Criterion | Xamarin | .NET MAUI |
|---|---|---|
| Platforms | iOS, Android, Windows | iOS, Android, Windows, macOS, Tizen |
| Base Framework | Mono + .NET Standard | .NET 6+ (unified BCL) |
| UI Framework | Xamarin.Forms | .NET MAUI (successor) |
| Support Status | End of Life since May 1, 2024 | Active Microsoft development |
| Hot Reload | Limited | XAML Hot Reload + C# Reload |
.NET MAUI (Multi-platform App UI) is the evolution of Xamarin.Forms, released by Microsoft in 2022 alongside .NET 6. MAUI unifies iOS, Android, Windows, and macOS into a single project without separate projects for each platform. Unlike Xamarin.Forms, MAUI uses .NET 6+ BCL instead of Mono and .NET Standard.
Microsoft provides a migration tool — .NET Upgrade Assistant for Visual Studio. It analyzes the Xamarin.Forms project, replaces namespaces (Xamarin.Forms.* -> Microsoft.Maui.*), updates .csproj files (SDK-style format), and migrates Android and iOS settings into a unified configuration. After migration, the project can leverage all new .NET 8 capabilities: Native AOT, CodeQL for security, and improved build performance.
The key change is a single project. While Xamarin.Forms required 3 separate projects (iOS, Android, .NET Standard), .NET MAUI uses one project with Platforms/iOS, Platforms/Android, Platforms/Windows, and Platforms/MacCatalyst folders. Each platform compiles from shared code with platform-specific conditional directives (#if ANDROID, #if IOS).
For existing codebases, .NET MAUI maintains 90% backward compatibility with Xamarin.Forms. API compatibility covers ContentView, ContentPage, Shell, NavigationPage, DependencyService, and MessagingCenter. The main changes affected Device.StartTimer (replaced by IDispatcher), Platform API (moved to Microsoft.Maui.ApplicationModel), and deprecated renderers (replaced by Handlers).
The migration process includes five steps. First — update Xamarin.Forms to the latest version 5.0. Second — replace .NET Standard 2.0 with .NET 6 or 8. Third — run Upgrade Assistant for automatic project conversion. Fourth — fix platform-specific code in the Platforms folders. Fifth — testing, especially custom renderers and platform services.
Frequently Asked Questions
Xamarin is a Microsoft mobile platform for C# development targeting iOS, Android, and Windows. It uses Mono Runtime for shared code compilation and provides two approaches: Xamarin.Forms (unified UI via XAML) and Xamarin.Native (platform-native screens). Since 2024, Xamarin is in support mode.
Xamarin uses C# and .NET, rendering through native controls (UIKit, View) via bindings. Flutter uses Dart and its own rendering engine (Impeller), without relying on native UI components. Flutter provides a consistent look across all platforms, while Xamarin provides the native look of each OS. Flutter is backed by Google and holds 46% versus 15% for Xamarin.
No. Microsoft discontinued support for Xamarin on May 1, 2024. All new projects should be started on .NET MAUI — its successor, which is built into .NET 8 and will receive updates alongside the .NET platform. For existing Xamarin.Forms projects, migration is recommended within 12–18 months.
The difference is negligible for regular applications. Xamarin.Forms adds 5–10% rendering overhead due to Managed-Wrapper-Native layers. Issues arise with heavy lists (ListView vs RecyclerView) and animations (using Xamarin.Forms without platform APIs). It is recommended to use CollectionView (replaced ListView) and native animations.
Yes, through Android Bindings Library. This .NET project type wraps AAR or JAR archives into C# bindings with automatic class and method generation. Kotlin libraries require additional handlers for coroutines and sealed classes, configured via Metadata.xml in the Binding Library.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also