Easi Blog

Building Native Mobile and Desktop Apps with .NET MAUI

Written by Robin Lenaerts | May 2, 2023 9:26:00 AM

.NET Maui
 
.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. https://learn.microsoft.com/en-us/dotnet/maui/what-is-maui?view=net-maui-7.0

What is .NET MAUI?

With .NET 6 and continuing in .NET 7, Microsoft introduced the MAUI to the world and it is exciting!
.NET Maui is an evolution of Xamarin.Forms that uses XAML and c# to make native apps. The difference is that now, it is truly cross-platform.

With Xamarin.Forms it was possible to make cross-platform applications however your codebase was split into multiple projects. One for each supported platform. With MAUI, you can create multi-platform apps using a single project and, where necessary, platform specific code and resources can be implemented.

Easy Access

MAUI provides a set of cross-platform APIs for native device features like:

  • Access to sensors such as accelerometer or compass on devices
  • Device network state
  • Access to systems clipboard
  • File access on the device
  • ...

This means that if your app needs to access the devices file system, it can be done with a single piece of code instead of having to write a different block of code for each platform you want to support!

But it gets better...

At Easi, we have a lot of very experienced developers in web technologies. Wouldn't it be nice to be able to use that to make our MAUI application?
Well we can! We can use Razor components to build our application. These Razor components use HTML, JS and CSS! This is very beneficial as making a native application does not always mean starting from scratch and spending time learning new technologies.

... And better

Now that we made an application using Razor components, we can reuse the same razor components to make a server hosted web app. So if you wish to have a website and accompanying desktop/mobile app we can do all that with the same UI components, cutting down on a lot of work and time!