.NET MAUI: The evolution of Xamarin.Forms (1/2)

Noureddine Maachi 04/10/2022
    Desarrollo Web a Medida para Empresas

    From Pasiona, we place great emphasis on Microsoft technologies in all our Mobile developments, and although we work with other technologies, such as React Native, our bet for years is Xamarin.Forms, a bet that has led us to great successes, such as being the first mobile application with facial recognition, to Arquia, warehouse management for Vivace, personnel management for Uriach and a long list that you can see in our portal about Our success stories.

    But everything in this life evolves, and Xamarin.Forms could not be less, that’s why we have decided to make this series of articles, where we will try in a brief way to explain why Pasiona continues to bet on this technology.

    The evolution of Xamarin.Forms, called .NET MAUI, is Microsoft’s latest for cross-platform app development. With this, Microsoft seeks to improve development in many aspects.

    The first question that many of you will surely ask is, is it just an update of Xamarin.Forms? If you want a simplistic answer we can say that YES is an update of Xamarin.Forms, but if we go into detail we realize that no, since from Redmond they have done an outstanding job, both for the development of the applications, as the final result obtained. So we can assure that it is much more than an update is a leap to a new mentality in the development of cross-platform native applications:

    • We went from .NET Standard to .NET 6.
    • Performance improvement.
    • Better folder organization.
    • More supported platforms (MacOS, Tizen-Linux). With only one project it allows us to develop native applications with shared code and UI.Table showing a graph with the header of .NET 6 within the .NET Multi-platform App UI, and outside this box the operating systems for which they can be developed, iOS, Android, MacOS, Windows and Tizen.

     

    What is .NET MAUI?

    .NET MAUI is open source and is the evolution of Xamarin.Forms, extended from mobile environments to desktop. If you are already familiar with Xamarin.Forms you will notice that there are many similarities with .NET MAUI, however, there are also some differences. With .NET MAUI you can create cross-platform applications using a single project.

     

    Image where you can see the structure of projects in Xamarin.Forms where we have one project per platform comparing it with the structure of .NET MAUI in which we only have a single project.

     

    We improve in performance, the execution time decreases, since it builds a single project instead of two as in Xamarin.Forms (the shared project and the one of the platform on which it runs).

    We have greater flexibility, since .NET MAUI adapts us very easily to be able to change or add the resources for our application. For example, suppose we want to add the icon of the application, in Xamarin.Forms we would have to add that icon for each platform and in a specific way for each of them, however, with .NET MAUI it is enough to place it in a single location.

    Both the resources of the application (fonts, images, logo of the application, etc.) and specific code by platform can also be added without any problem if necessary. One of the main goals of .NET MAUI is to enable you to implement all of your app’s logic and UI in a single code base.

    Table showing the steps followed when programming the application with the block

     

    • Primarily, what we do is code with the .NET MAUI API. This is where the whole issue of controls, libraries, etc., that the MAUI API offers us to develop all the logic and UI of our cross-platform application.
    • If necessary, in the event that we want to modify or intervene specifically in a platform, we can do so from the code of our application.
    • The usual behavior would be that, once our logic and UI are coded, .NET MAUI will be responsible for executing it for each platform in the most efficient and native way possible.

     

    We move to .NET 6

    .NET MAUI is built into .NET 6, while Xamarin.Forms is .NET Standard. Due to the integration of .NET 6, we will be able to use all its functions and C# 10 in .NET MAUI.

    This shows us how Microsoft is really involved in cross-platform development, since thanks to .NET 6 we have complete compatibility with all .NET 6 projects since they all share the same libraries / APIs base.

    Box showing a graph with the header of

     

    Links/Contributions/Examples

    Soon, we will publish the following article .NET MAUI – The evolution of Xamarin.Forms (2/2) where we will go into technical detail about the news of .NET MAUI. We leave you some links that will surely be of great help both theoretically and technically:

     

     

    , , ,

    Go back