/ 08.10.2024
If you’re wondering whether .Net MAUI will replace Xamarin, then you’ve come to the right place because, according to current data, Microsoft is phasing out support for Xamarin Forms as of May 01, 2024. Due to the discontinuation of platform support, companies are faced with the decision of whether to migrate the product to .NET MAUI as a successor to Xamarin.Forms or using popular cross-platform frameworks like Flutter or React Native.
Developers are always looking for faster, simpler, and cheaper ways to deliver products to market. Many cross-platform solutions reduce the cost and complexity of projects by enabling support for multiple platforms from a single codebase. This can significantly affect time-to-market and product availability, as you only need to write the application code once and then run it on each device.
Table of Contents
What is the choice for the development of cross-platform apps?
Choosing the right platform for your next project can be difficult. Popular solutions in this area include React Native, Ionic, Microsoft’s .NET MAUI, and Google-backed Flutter. While no technology is perfect, but certainly one of them may be a better fit for your project system requirements. Even if it is less favorable on the surface, that’s why knowing the pros and cons of the available solutions is essential.
Let’s start with some basic knowledge of these frameworks.
What is .Net MAUI?
To fully understand what .Net MAUI is, let’s take a short trip through its evolution.
Xamarin
Xamarin is a tool used for cross-platform development. It was released in May 2011 by the engineers who created Mono, Xamarin.Android and Xamarin.iOS. Until 2014, Xamarin views had to be implemented separately for each platform ((XML – Android, Storyboard/ XIB – iOS). The introduction of Xamarin Forms made creating a common view layer possible, regardless of the platform. Eventually, Mono became Xamarin and, in 2016, became part of Microsoft’s .NET MAUI, which was built on the foundation of Xamarin, which enabled developers to write code in C#, making it available on iOS and Android platforms.
Xamarin Forms
In 2014, Xamarin.Forms was added to the framework, enabling user interface reuse across platforms and reducing time to market. A user-friendly way of designing interfaces using XAML was then introduced. This innovation made creating user interfaces that seamlessly adapt to different platforms easier.
.NET MAUI
In 2020, Microsoft announced MAUI (Multi-platform App UI), an evolution of Xamarin.Forms. Released in May 2022. MAUI takes the best aspects of Xamarin.Forms the platform and takes them to a new level. The big news in MAUI is that if we need a solution for each platform within our project in Xamarin.Forms, now we will have one code base in one project. This means you can write the code once and run it on multiple target platforms, simplifying programming and ensuring consistency.
So, let’s summarize some key points about .NET MAUI:
Key features of the .Net MAUI as a cross-platform framework
Programming language
.NET MAUI uses C#, which is a mature and widely used programming language developed by Microsoft. C# is known for its object-oriented features and strong support for enterprise application development.
More native than cross-platform
.NET MAUI uses a hybrid approach. It uses a single C# code base to support iOS and Android but requires a separate code base for web and desktop. This means additional code must be written to support these other platforms.
Community and support
.NET MAUI is a newer framework, so its community support on GitHub continues to grow, collecting a rating of 21.3k stars (February 2024). However, it is backed by Microsoft, which means it will likely have a long-term future. .NET MAUI also has strong compatibility with existing .NET libraries and tools.
Performance and user experience
.NET MAUI is still in development, so its performance and user experience are less mature than Flutter’s. However, .NET MAUI is expected to improve in these areas over time.
Productivity
Ability to create beautiful and faster applications by integrating Visual Studio Enterprise capabilities with .NET MAUI.
Does .Net MAUI have a future?
According to developers who have worked in Xamarin, .Net MAUI is a good choice for those who know and work in .NET/C#. MAUI is a relatively new solution and is still under an intensive development process. Porting the core functionality of Xamarin to MAUI is a challenge and is not always successful. For many .Net developers, MAUI is quite immature and not very convenient for everyday coding. The user experience, hot-reloading, and XAML are unsatisfactory, and the compilation time is too long.
This is because MAUI is simply a large iteration in Xamarin Forms. The repository shows that half of the open issues are regression bugs) and the other half are Xamarin issues.
One gets the impression that Microsoft hasn’t yet decided what direction it wants to take MAUI development, and this is its main problem. There are many ways to write MAUI applications and many different ways of doing things. Among other things, the choice of approach depends on whether you use MVVM (Model – View – ViewModel ), MVU (Model-View-Update), Maui or XAML markup, or Blazor Hybrid. What about Maui Blazor bindings? These are two very different solutions. One simply provides a Blazor web application, and the other uses the Blazor programming style using all native components.
This constantly gives MAUI the impression of chaos, in which it is quite difficult to search for information since there are many different approaches to solving problems. That’s why it’s recommended not to develop applications exclusively in MAUI, but to use it as a wrapper that compiles a website for different purposes. In contrast, there is certainly a bright future ahead for Blazor and the upcoming Blazor United, which works well with MAUI.
So, let’s summarize the .Net MAUI:
- It is still new on the market
As an evolution of Xamarin.Forms, it still faces some unresolved issues. Developers may encounter bugs or limitations that can affect project development timelines and overall stability. Although Microsoft supports .NET MAUI, it may take some time for the platform to mature and reach the same level of stability and reliability as more established alternatives such as React Native or Flutter.
- Dependent on the .NET ecosystem
While this is beneficial for developers already familiar with .NET technologies, for those using other programming languages, the entry threshold is difficult. In contrast, frameworks such as Flutter and React Native use Dart and JavaScript, respectively, which are accessible and attractive to a wider range of developers.
- Weaker platform performance
.Net MAUI, while superior to the Xamarin.Forms platform does not always match the performance of native programming or other cross-platform solutions such as Flutter. This can result in slower application startup or reduced responsiveness, which can have a negative impact on user perception.
We will now focus on discussing the main features of Flutter, one of the more popular frameworks on the market.
What is Flutter?
Flutter is an open-source SDK for creating cross-platform applications released by Google in 2017. It has taken the cross-platform apps industry by storm, and by 2023, 36,889 projects will have been built using Flutter, which is one of the top 4 app development frameworks available today.
The chart below shows that Flutter’s popularity has grown steadily over the years.
Source: https://trends.builtwith.com/framework/Flutter
And according to a Statista survey of developers in 2022, Flutter is the most popular cross-platform mobile framework used by global developers. Based on the survey, 46 percent of developers used Flutter. Overall, about one-third of mobile developers use cross-platform technologies or frameworks; the rest of mobile developers use native tools.
Why is Flutter widely used in cross-platform applications?
Flutter offers high development speed in cross-platform app development process and leads to more user-friendly applications. It has a different approach than other cross-platform solutions. It uses the Dart programming language, developed by Google, to avoid the need for separate declarative languages such as JSX or XML to define layouts or code. Flutter is written in this single language, giving more tool options since both the user interface and logic share the same structure. Therefore, Flutter has one of the best IDEs and development tools to make developers’ lives easier.
So let’s summarize what is worth knowing about Flutter:
- Language and ecosystem
Flutter uses Dart as its programming language, which offers a reactive and declarative approach to building user interfaces with C#-like syntax. The ecosystem includes a rich set of packages and plugins available through pub.dev.
- User Interface Rendering
Flutter uses a custom rendering engine, Skia, to create a faster user interface with visually appealing and consistent components. Widgets in Flutter are highly customizable and enable pixel-perfect designs.
- Popularity and community
Flutter has gained immense popularity among developers, especially for mobile app development, and its vibrant community contributes to its development. It has a strong presence on platforms such as Stack Overflow and GitHub.
- Target platform? A multi-platform approach
Flutter uses a single codebase and base to support many platforms, including iOS, Android, web, and desktop (unified API). This means you can write your code once and then deploy it to all these platforms without any changes. Flutter achieves this with a “write once, run everywhere” (WORA) approach, in which the same code is compiled into native code for each platform.
- Large community and support
Flutter has a much larger and more active community than .Net MAUI. This means there are more resources available to Flutter developers, such as tutorials, documentation, and third-party libraries. Flutter also has a wider range of supported devices.
- Performance and user experience
Flutter is known for its high performance and excellent user experience. It uses the Skia graphics engine, which is known for its speed and performance. Flutter also provides a number of built-in widgets, allowing developers to create native-looking user interfaces.
Is Flutter a future technology?
Flutter is a solid technology for rapid app development because of its high-performance rendering engine and the built-in rich set of widgets. It certainly has a future for cross-platform development and is great for creating apps for startups that want to build an MVP as quickly as possible. Google continues to invest heavily in Android’s native development ecosystem, constantly developing and updating new libraries. A big advantage is that Flutter is an open-source project with a large and growing community.
Even if the entire Flutter team were to be fired, surely many would continue to work on the project and even create a foundation to continue its development. Engineers can continue contributing to Flutter no matter where they go, unlike any proprietary app (Stadia, other Google apps that are no longer in development). Besides, there will still be open-source contributors and other companies (Bytedance, Alibaba, Sony, Ubuntu) who care about continuing to maintain it.
When is .Net MAUI better to use than Flutter?
.NET MAUI may be a better choice than Flutter in some scenarios:
- Language preference
If your development team is more comfortable with C# and XAML, .NET MAUI may be a better choice because it uses those languages.
- Integration
.NET MAUI integrates well with Visual Studio and Visual Studio Code
- A large collection of NuGet packages and .Net tools that are available when working with Maui.
Nevertheless, we must be aware that dedicating time is necessary to integrate adequate support and fully adapt all Xamarin packages to capitalize on this ecosystem.
When is Flutter better than .Net MAUI?
The main advantage is great application performance and developer experience.
- More native device features
Flutter uses native UI components. In MAUI, this can also be a drawback, depending on your preference, as it can cause visual inconsistencies between different mobile platforms.
- Flutter apps tend to be smaller and faster than those built using .Net MAUI.
Thanks to Flutter’s AOT (Ahead Of Time) compilation, which reduces the size of the compiled code, an experienced Flutter developer can quickly deliver functionality with many ready-to-use customizable widgets and good built-in documentation.
- Flutter is more mature than MAUI.
Many applications built with Flutter can be downloaded and tested, making it an easier choice.
- The Flutter engine can run as a whole application, which means that by choosing Flutter, developers are not limited by it
It is easy to switch to native code or add a Flutter screen to existing native applications. This allows Flutter to be tested and presented very quickly.
- Create cross-platform applications faster
Flutter currently supports platforms such as Windows, iOS, Android, Google Fuchsia, Web platform, Linux, macOS Windows, and embedded devices (automotive or electronics industry, e.g., displays, digital clocks). Flutter developers can write complex apps from a single code base and conveniently create multi-platform applications at affordable prices. It also saves a lot of time.
- Save costs by creating MVPs
Flutter is suitable for developing MVPs or minimum viable products because of its scalability, flexibility, and use of built-in widgets. Developers can quickly build an MVP for their project and make changes faster to meet custom requirements and releases, reducing time to market.
- You create applications that are visually appealing
Flutter is widget-based and its app architecture can be used to design engaging application user interfaces. You can also use Flutter Flow‘s visual app builder to create engaging UI designs without coding.
Create cross-platform applications depending on your needs.
As we mentioned above, both .NET MAUI and Flutter are tools for developing cross-platform applications. Flutter is a good choice for projects that require a fast development cycle, a wide range of supported devices, and a strong community. .NET MAUI is suitable for projects that require a commonly used programming language and strong compatibility with existing .NET libraries and tools.
The choice between the two often depends on specific project requirements, the team’s knowledge of the languages and tools, and personal preferences.
Need advice on .NET MAUI or Flutter? For more information on anything related to .NET or Flutter, contact us anytime. We’ll be happy to help you choose the right solutions.
Sources:
· https://www.c-sharpcorner.com/article/maui-the-future-of-xamarin-forms/
· https://github.com/dotnet/maui