Welcome to the Sands of MAUI—newsletter-style issues dedicated to bringing together the 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.
.NET developers are excited with the reality of .NET Multi-platform App UI (.NET MAUI)—the evolution of modern .NET cross-platform developer technology stack. With stable tooling and a rich ecosystem, .NET MAUI empowers developers to build native cross-platform apps for mobile/desktop from single shared codebase, while inviting web technologies in the mix.
While it may take a long flight to reach the sands of MAUI island, developer excitement around .NET MAUI is quite palpable with all the created content. Like the grains of sand, every piece of news/article/documentation/video/tutorial/livestream contributes toward developer experiences 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 March 25, 2024:
Modern mobile/desktop apps often strive for delightful UX and pixel-perfect UI is one way developers achieve the goal. For .NET MAUI developers using XAML to build the app visual tree, getting layouts exactly right can sometimes be a challenge—some visual helpers to check design implementation and UI perfection would be nice. That’s exactly what Plugin.Maui.DebugRainbows by Steven Thewissen aims to do, and Gerald Versluis produced a video about it—making pixel-perfect UI with DebugRainbows for .NET MAUI.
Gerald starts out introducing Plugin.Maui.DebugRainbows—installing the NuGet package and configuring it to be used inside a .NET MAUI app is pretty easy. Once setup in a running app, DebugRainbows colors all UI elements automatically—this way, developers can check positioning/location of every visual UI component easily.
Furthermore, developers can use an overlay grid on top of the app UI with configurable colors. This makes it trivial to check UI alignment, verify which elements might be taking up unnecessary space or trace elements that might not be behaving as expected. Overall, the new Plugin.Maui.DebugRainbows is a wonderful plugin for .NET MAUI developers to produce gorgeous UI—perfect down to each pixel.
.NET MAUI is built to enable .NET developers to create cross-platform apps for Android, iOS, macOS and Windows, with deep native integrations, platform-native UI and hybrid experiences that extend the reach of Blazor/JS web UI technologies. Modern mobile/desktop apps should strive to be accessible and one of the best ways to include folks with low vision is baked into most platforms—text to speech capabilities are wonderful. Thankfully for .NET MAUI developers, it does not take much to light up text-to-speech functionality, and Leomaris Reyes wrote up an article about text-to-speech in .NET MAUI.
Leomaris dives into what .NET MAUI developers need to do to enable text-to-speech capabilities. The Microsoft.Maui.Media namespace provides default implementation of the ITextToSpeech interface. All of .NET MAUI’s target platforms of iOS, Android, Windows and macOS have support for text-to-speech functionality. Developers need to leverage the device’s built-in text-to-speech engines to read the provided text aloud. The SpeakAsync method takes in the mandatory Text parameter, but optional speech parameters allow developers to further customize the experience—like controlling the Pitch, Volume and Locale.
Through easy to follow code and examples, Leomaris showcases the ease to implement text-to-speech in .NET MAUI along with covering some API limitations—a great read for .NET MAUI developers looking to build accessible apps.
.NET MAUI is the evolution of modern .NET cross-platform development stack, allowing developers to reach mobile and desktop form factors from single shared codebase. The present reality for many apps, however, may be Xamarin or Xamarin.Forms. A migration strategy is needed to move things forward. David Ortinau wants to bring everyone along and produced a video—migrating apps from Xamarin.Forms to .NET MAUI.
May 2024 is when official support runs out for Xamarin and Xamarin.Forms—now would be a great time to start the migration to .NET MAUI. David start out with .NET Upgrade Assistant tool—it’s come a long way in aiding Xamarin to .NET MAUI migrations. Today’s tooling takes care of configuration updates to SDK style projects, remaps namespaces, replaces dependencies and suggests code changes to reuse as much of C#/XAML code between Xamarin and .NET MAUI. The real benefits of moving to .NET MAUI are the truly shared single project, reusable assets, dependency injection and increased platform reach.
For folks doing the upgrade manually, David pointed out solid documentation, compatibility aids and wealth of community resources to help developers move apps forward. While the clock is ticking, there is a lot of help and encouragement to upgrade from Xamarin to .NET MAUI—upwards and onwards.
Gone Mobile is a long-running popular podcast that has evolved over time. Hosted by Jonathan Dick and Allan Ritchie, Gone Mobile covers all things mobile development, particularly with .NET MAUI, and delves into topics of cross-platform development, design and marketing of mobile apps. A recent episode should be a great listen for all .NET MAUI developers—all about Blazor Hybrid apps with .NET MAUI.
In the episode, Jon and Allan discuss the promise of Blazor inside .NET MAUI apps—the opportunity to utilize native platform APIs, but also the challenges of performance considerations and compatibility with different platforms. The conversation explores the anatomy of Blazor Hybrid apps and acknowledges the potential for code reuse across web/native apps. Cross-platform app development is never easy—the mix and match of Blazor with .NET MAUI promises an ecosystem promoting code reuse and increased developer productivity.
It is the age of artificial intelligence (AI). AI is slowly changing the way we live and work, and AI’s popularity is driving adoption in enterprise and consumer apps. AI presents a huge opportunity for .NET developers to infuse apps with solutions powered by Generative AI and Large Language Models (LLMs). With .NET 8, there is plenty of help for developers, as Jordan Matthiesen points out—say hello to AI for .NET developer quickstarts.
There is plenty of content for .NET developers to learn core concepts—like getting started with OpenAI with .NET, AI completions, prompt engineering and ChatGPT integrations. With the new quick starts, developers have full-blown integration examples of leveraging LLMs from OpenAI for interesting scenarios—summarizing text, building chat apps or generating images.
Each of the quick-start guides takes developers on a step-by-step journey through the code toward accomplishing specific AI tasks. Moost use the Azure OpenAI SDK with more varied samples coming. AI is eating the world and developers, including .NET MAUI ones, can get started with AI explorations with modern .NET.
That’s it for now.
We’ll see you next week with more awesome content relevant to .NET MAUI.
Cheers, developers!
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.