Topics In Demand
Notification
New

No notification found.

All About MAUI and Comparison with Xamarin
All About MAUI and Comparison with Xamarin

August 10, 2022

302

0

The .NET desktop development environment is packed with various features, ranging from classic (Windows Presentation Foundation (WPF) and Windows Forms (WinForms)) to modern (Blazor and .NET MAUI).

.NET Multi-platform App UI (MAUI) is a framework for creating custom mobile, tablet, and desktop applications.

In this article, we will discuss MAUI origins, compare it with Xamarin, and give you a few pointers about getting started with MAUI. Let’s begin with a quick overview of this technology’s background.

Xamarin.Forms Overview - MAUI Origins

Simply put, Xamarin.Forms is an abstraction layer or framework that allows the shared code to interact with the base Android, iOS, and Windows source code.

A cross-platform mobile app developer can save time and effort by writing all their business logic in Xamarin.Forms.

Microsoft took over Xamarin in February 2016. After the annual Microsoft Build conference, it was clear that Xamarin tooling would be merged seamlessly with .NET, and all runtimes, components, and SDKs would be brought together.

To achieve this unification, Xamarin had to be fully integrated into .NET. That’s how the idea of .NET MAUI was born. However, you shouldn't assume that's all .NET MAUI is. A lot has changed from Xamaring to MAUI, which we’ll explain more later in this blog.

Note: the .NET Multi-platform App UI has already been released. But at the time of writing this article, .NET MAUI Visual Studio integration is still in testing. The information in this article refers to a product in development that may be greatly altered before it's launched.

The Development of .NET MAUI

As a developer, you can use a plethora of tools provided by Xamarin to create cross-platform mobile applications. Xamarin is essentially the framework that allows you to develop cross-platform mobile applications in C#.

In addition, it enables developers to exchange their codes across all platforms. Many companies have used the mobile expertise of Xamarin on .NET for years.

.NET MAUI brings this success on mobile in convergence with the desktop, making it the most efficient way to build multi-platform applications for both.

.NET developers can choose from a wide selection of options through MAUI, which supports all major platforms: Android, iOS, macOS, and Windows.

You can provide no-compromise user experiences while exchanging even more code with a convenient, cross-platform API that reveals the native features of each platform and user navigation control.

When combined with Visual Studio productivity tools and emulators, .NET and Visual Studio significantly enhance the development workflow for creating apps targeting various kinds of devices.

Why MAUI - Advantages of .NET MAUI

Making the correct business decision requires picking the most appropriate framework. It can impact the price and performance of your app and your organization in the long term.

Opting for unreliable frameworks can dramatically raise your operational costs and threaten your daily activities when a developer is forced to depart from your company. An “unreliable” framework has the following features.

  1. High demand for developers, and
  2. A limited supply of IT professionals.

The Base Class Library (BCL) indeed allows apps running on multiple platforms to share the same business logic. However, each platform follows a unique approach to designing the user interface.

Additionally, they provide different models for explaining how user interface elements work together and interact. Of course, as with almost everything else in the world of technology, there’s a solution to this issue: finding a suitable all-in-one tool.

The .NET MAUI offers a unified platform environment of coding to Visual Studio 2022. .NET MAUI apps can be developed on PC or Mac and be packaged into native app formats. Moreover, it has:

  • Page layout engine with advanced functions.
  • A thriving community
  • Support for .NET and XAML hot reload
  • Only one project, one codebase.
  • Multiplatform APIs for utilizing native device features.
  • Cross-platform visuals.

Using the relevant platform-specific framework, you can independently build the UI for each platform. However, this strategy also requires you (or a professional third party) to maintain a codebase for each separate type of device.

.NET MAUI Vs Xamarin

Xamarin.Forms and .NET MAUI share many similarities, which you’ll notice if you have worked with Xamarin.Forms in the past.

In fact, .NET MAUI shares most of its features with Xamarin.Forms since it is an improved version of Xamarin.Forms. .NET MAUI has almost everything that Xamarin has, including controls, designs, Shell, actions, UI elements, and cross-platform APIs for device features.

The two indeed have some similarities, but they also have many differences.

In terms of project structure, Xamarin.Forms and .NET MAUI are fundamentally different. .NET MAUI is an easy-to-use project. As a result, it uses a target-based structure, while Xamarin’s platform-dependent components and code are managed within separate projects.

BCL compatibility is also a key aspect of this change as Xamarin evolves into a true part of .NET. Now, Xamarin. Essentials have discontinued the switch to multiple naming conventions such as Microsoft.MAUI.Device.

What's more, the .NET MAUI framework allows you to integrate Microsoft Blazor’s web elements and create apps with #C instead of JavaScript.

Want to hire Xamarin developers, if you have questions about switching from Xamarin.Forms to MAUI.

Note: In 2023, Xamarin's current version (Xamarin.Forms 5.0) may no longer be supported by Microsoft.

Getting Started with MAUI Projects

If you’re a .NET developer, you can choose from three options to use .NET MAUI:

  1. Standard .NET MAUI App
  2. .NET MAUI Blazor App
  3. .NET MAUI Class Library.

You’ll also need a Windows 10 coding setup since Visual Studio for Mac compatibility with .NET MAUI is scheduled for a later release.

Your Windows 10 environment should (preferably) be connected to a macOS device with Xamarin.iOS and Xcode installed.

Using Integrated Development Environments (IDEs) like Visual Studio, .NET development companies can design and develop native Android, iOS, macOS, and Windows applications with MAUI.

Conclusion

MAUI's goal is to help you implement as much of your app logic and UI layout in one code base as possible. The .NET MAUI is an enhancement to Xamarin, which naturally increases programmers' productivity as well.


That the contents of third-party articles/blogs published here on the website, and the interpretation of all information in the article/blogs such as data, maps, numbers, opinions etc. displayed in the article/blogs and views or the opinions expressed within the content are solely of the author's; and do not reflect the opinions and beliefs of NASSCOM or its affiliates in any manner. NASSCOM does not take any liability w.r.t. content in any manner and will not be liable in any manner whatsoever for any kind of liability arising out of any act, error or omission. The contents of third-party article/blogs published, are provided solely as convenience; and the presence of these articles/blogs should not, under any circumstances, be considered as an endorsement of the contents by NASSCOM in any manner; and if you chose to access these articles/blogs , you do so at your own risk.


kiranbeladiya

© Copyright nasscom. All Rights Reserved.