Telerik blogs

Welcome to the Sands of MAUI—newsletter-style issues dedicated to bringing together latest .NET MAUI content relevant to developers.

A particle of sand—tiny and innocuous. But put a lot of sand particles together and we have something big—a force to reckon with. It is the smallest grains of sand that often add up to form massive beaches, dunes and deserts.

Most .NET developers are excited with .NET Multi-platform App UI (MAUI)—the evolution of modern .NET cross-platform developer experience. Going forward, developers should have much more confidence in the technology stack and tools as .NET MAUI empowers native cross-platform solutions on both mobile and desktop.

While it may take a long flight to reach the sands of MAUI island, developer excitement around .NET MAUI is quite palpable in all the shared content. Like the grains of sand, every piece of news/article/documentation/video/tutorial/livestream contributes towards developer knowledge in .NET MAUI and we grow a community/ecosystem willing to learn & help.

Sands of MAUI is a humble attempt to collect all the .NET MAUI awesomeness in one place. Here's what is noteworthy for the week of April 3, 2023:

Blazor UI in .NET MAUI

Blazor and .NET MAUI are almost made for each other, sharing the underlying .NET runtime—.NET 6 yesterday, .NET 7 today and .NET 8 tomorrow. Blazor apps can now be easily hosted inside .NET MAUI native apps, with full native platform integration. Blazor Hybrid apps, as they are called, enable a lot of code sharing across web and native apps on mobile/desktop. While Blazor might feel welcome on mobile/desktop apps, do Blazor UI components work seamlessly inside native apps?

While early days, the promise is big and yours truly wrote up a piece—Telerik Blazor UI in Native Apps.

Blazor is the open-source beloved modern web framework for building interactive web apps, with C# front and back. There is plenty of UI help for Blazor developers with component libraries like Telerik UI for Blazor—100+ UI controls that are customizable, performance-tuned and with easy integration into design systems. .NET MAUI is the evolution of .NET cross-platform strategy—a framework for creating native mobile and desktop apps with C#/XAML. However, .NET MAUI brings in a wonderful UI component called the BlazorWebView—an abstraction that hosts evergreen browser components on respective platforms and allows for rendering of web artifacts within the shell of native apps.

The question is obvious for Blazor developers—will Telerik Blazor UI components now just work on mobile/desktop apps through .NET MAUI? While experimental, the answer is yes—Telerik Blazor UI can be brought in easily inside .NET MAUI Blazor projects and be able to render polished Blazor components on mobile/desktop. UI is your jam and the world is your bread—developers call the shots.

Xamarin.Forms to .NET MAUI

.NET MAUI is the direct evolution of Xamarin.Forms, taking .NET code to not just iOS/Android but also to Windows/macOS. While .NET MAUI is the future of cross-platform development on .NET, for many teams/individuals, Xamarin.Forms is very much the reality today. Thankfully, investments in Xamarrin.Forms move forward nicely, but there are some nuances to understand and plot the migration to .NET MAUI. Rossitza Fakalieva has some advice and wrote up an article—should you migrate from Xamarin.Forms to .NET MAUI and when?

Rossi starts out laying the case for why the migration to .NET MAUI is beneficial—latest .NET runtime, stable tooling on Windows/MacOS and frequent updates addressing developer/performance concerns are definitely appreciated. In terms of developer productivity, .NET MAUI has baked in support for CLI tools, simplified project structure, shared resources and easier UI customization. For end users, .NET MAUI presents a modern approach to desktop apps and better accessibility support.

.NET MAUI does, however, have higher platform requirements—as in iOS 10+ and Android API 21+, while Xamarin.Forms can still serve older versions. Hopefully, users can update and developers can move apps forward—there is a timeline of Xamarin support until 2024.

.NET MAUI came out with .NET 6, matured with .NET 7 and is looking ahead to flourish with .NET 8—hopefully, developers can follow the natural evolution of Xamarin.Forms apps to .NET MAUI, sooner than later.

Tooling Roadblocks

.NET MAUI is mature with stable runtime and tooling—this essentially means lot more developers are building serious mobile/desktop apps. However, as developers kick the tires more, technology stacks start showing some pain points—little annoyances in tooling that may frustrate developers.

While most of these issues are not hard to fix, it's great when seasoned developers share their experiences and save others a bunch of time. Khalid Abuhakmeh as pro as developers get and he took the time to write up some workarounds for common developer issues—panacea for when .NET MAUI apps/projects stop working.

.NET MAUI runtime/tooling has to depend on a lot of things to pull off the cross-platform promise. Developers may have been working successfully on a .NET MAUI app for some time—but sudden tooling issues may crop up. When Visual Studio is screaming red or builds are broken, the most obvious culprit would be the SDK. Khalid walks through how developers can add a global.json file at the root of project, to pin down the appropriate runtime SDK band and corresponding workloads.

One wonderful benefit of .NET MAUI single project system is shared resources across platforms—the built-in image resizetzer works to produce images of various requirements from a single SVG/PNG. However, the same image resizing tooling can get confused and complain—Khalid talks about how developers can specify specific image file formats and skip offending file types. For folks using the MVVM design pattern with CommunityToolkit.Mvvm, there may be instances where passing parameters or finding commands may be troublesome—the fixes are easy and need developers to be deliberate.

Khalid also talks about how to always register DI dependencies or speed up .NET MAUI builds with specified TargetFrameworks—this is a golden write-up for .NET MAUI developers frustrated with everyday tooling issues.

Android Auto with .NET MAUI

The promise of .NET MAUI is to build the next generation of cross-platform apps with .NET that run on various platforms, like iOS, Android, Windows, macOS and Tizen. However, broad platform coverage also invites a wide plethora of devices serving various user interaction mediums like mobile, desktop, wearables, kiosks, TVs and more. One interesting avenue to explore is the Automotive industry with Android Auto and Apple CarPlay support—could .NET MAUI actually power apps that run on your car's dashboard screen?

The answer is yes, and Christian Strydom produced a detailed video—building an Android Auto app with .NET MAUI.

Christian starts off by explaining Android Auto for the uninitiated—this is the mode where a car's dashboard plays along with the app running on Android phone.

User safety is key when driving an automobile—there are understandable strict design and quality guidelines from Google on Android Auto. Christian shows off an amazing demo of an Android Auto app built with .NET MAUI running on a car dashboard screen—it must so satisfying to see your own code light up app experiences you can touch in your car's infotainment system.

The showcase included a templated solution that demonstrates the kind of things developers can pull off with .NET MAUI on Android Auto. Everything just works—from List pane to Grid templates, familiar UI paradigms and touch interactivity.

Christian then did a thorough walk-through of how developers can get started building for Android Auto using .NET MAUI—aside from usual .NET MAUI tooling/runtime, developers would need to install Android Studio, latest .NET MAUI runtime/tooling, requisite Plugins and be able to deploy apps to Android Auto simulators or real devices.

It is so nice to see a .NET MAUI app built from scratch with navigation and user interaction be able to run on car dashboard screen through Android Auto—cheers Christian for pushing the boundaries of what's possible with .NET MAUI.

Microsoft Build

Want to broaden your horizons and see what's cooking with Microsoft developer technologies beyond just .NET? The next big developer event is Microsoft Build, happening May 22-25, 2023.

Build promises to be a global digital event, while also being in-person event in Seattle. After a long hiatus due to the global pandemic, Build will be the first big Microsoft in-person developer event and the excitement is understandable.

The in-person Build experience will have live keynotes and advanced sessions/demos covering latest technologies and developer tools. Developers can take advantage of exclusive connection opportunities with experts and network with solution partners/peers. The free digital Build experience will have access to catalog of expert-led sessions and live broadcast of keynotes from anywhere on earth.

Developers can expect a plethora of news coming from Microsoft Build across most Microsoft technology stacks—Azure, AI, Microsoft 365, .NET and developer tooling. Registration for Build is now open and the countdown to May has begun.

That's it for now.

We'll see you next week with more awesome content relevant to .NET MAUI.

Cheers, developers!


SamBasu
About the Author

Sam Basu

Sam Basu is a technologist, author, speaker, Microsoft MVP, gadget-lover and Progress Developer Advocate for Telerik products. With a long developer background, he now spends much of his time advocating modern web/mobile/cloud development platforms on Microsoft/Telerik technology stacks. His spare times call for travel, fast cars, cricket and culinary adventures with the family. You can find him on the internet.

Related Posts

Comments

Comments are disabled in preview mode.