What is Xamarin? Let’s get to know the basics!
Xamarin is an open-source application platform from Microsoft that lets you develop high performant applications in Android, iOS, and UWP platforms with a single shared code base C#.
Xamarin is an open-source .NET platform with a strong community. Above all, it is absolutely free including for commercial use. Xamarin extends the .NET platform with more tools on top of it for application development across various platforms like Android, iOS, UWP, macOS, and more. Since it extends .NET you have the luxury to use all the libraries available to .NET developers.
Xamarin has two approaches to develop applications depending on the requirement.
- Traditional approach
- Xamarin Forms approach.
The traditional approach lets you create 100% native mobile application using .NET and C# with lots of code sharing. It gives access to 100% of native APIs to create native applications. Since it gives access to 100% native API, it is not just about the Android and iPhone targetted apps. We can also create Apple TV apps, Android Wear apps, and Apple Watch apps.
In short, everything you can do in Objective-C, Swift, Java, or Kotlin can be done in C# with Xamarin.
Xamarin Forms approach
In traditional approaches, we used C# to create 100% native applications. We had a shared logic layer where we have our business logic shared across all platforms. However, the UI there is still independent for each platform since the nature of the platforms is different. However, we have commonalities across the platforms, and to take advantage of it, Xamarin Forms is introduced.
Xamarin Forms is an open-source cross-platform UI framework for building iOS, Android, & Windows apps with .NET from a single shared codebase. It is an abstraction between all three platforms where they give an API to program the UI layers. It allows developers to create user interfaces in XAML with code-behind in C#. These interfaces are rendered as performant native controls on each platform. It is possible to have both the UI and the business logic shared across the platforms which let us write very less code. Certainly, this enables almost 100% code sharing on your application.
To sum up, Xamarin Forms is more than just a cross-platform UI library. It is a full application framework that includes everything you need to build mobile apps.
In addition, Xamarin Forms brings in advantages like XAML (Extensible Markup Language) for UI design, MVVM (Model-View-ViewModel), access to platform-specific libraries, consistent user interface design, build in pages, layout, controls, various open-source plugins and much more.
Xamarin is included in Visual Studio in all editions including the community edition at no additional cost. It can be coded using both PC and Mac with Visual Studio and Visual Studio for Mac. The code just works the same on both.
- Develop everything in C# and .NET
- Native performance
- Open source and free, including for commercial use.
- Shared logics and UI across various platforms
- 100% access to the native APIs
- Single development environment (Visual Studio)
- and many more…
In conclusion, Xamarin is really a complete mobile solution to build, test, develop, distribute, and monitor applications for multiple platforms.
I hope now you have got an idea about Xamarin and its working. So get started now by building your first application.
Thanks for reading. Please share your comments and feedback. Happy Coding…!
Working as a Senior Team Lead in S.i. Systems, Chennai, India. Having an overall experience of 8+ years in software development. His areas of interest are C#, Xamarin Forms, Xamarin Native, Azure, ASP .NET, SQL Server, etc..