Welcome to Sands of MAUI, a newsletter-style publication that compiles the latest .NET MAUI content relevant to developers.
Small, harmless sand particles. But when you add together many sand particles, we have a large force to consider. It is the smallest grains of sand that often combine to form huge beaches, dunes, and deserts.
.NET developers are excited about the reality of .NET MAUI (.NET Multiplatform App UI), the latest evolution of the .NET cross-platform developer technology stack. With reliable tools and a rich ecosystem, .NET MAUI helps developers build native cross-platform apps for mobile/desktop from a single, shared codebase while bringing web technologies into the mix.
It may take a long flight to reach the sands of MAUI Island, but developer excitement for .NET MAUI is quite evident in all the content created. Like a grain of sand, every news/article/document/video/tutorial/live stream contributes to the developer experience of .NET MAUI and we grow a community/ecosystem willing to learn and help.
Sands of MAUI is a humble attempt to bring together all the goodness of .NET MAUI in one place. Here are some highlights this week: March 25, 2024:
Designing a Rainbow Using .NET MAUI
Modern mobile/desktop apps often strive for a pleasant UX, and pixel-perfect UI is one way developers achieve that goal. For .NET MAUI developers who use XAML to build their app’s visual tree, getting the layout right can sometimes be difficult. It would be nice to have a visual helper to ensure design implementation and UI perfection. This is exactly what Steven Thewissen’s Plugin.Maui.DebugRainbows aims to do. Gerald Bersluis I created a video on how to create a pixel-perfect UI using DebugRainbows for .NET MAUI.
Gerald starts by introducing Plugin.Maui.DebugRainbows. It’s very easy to install the NuGet package and configure it for use within your .NET MAUI app. Once set up in a running app, DebugRainbows automatically colors all UI elements. This allows developers to easily see the location/location of all visual UI components.
Developers can also use an overlay grid over their app UI with configurable colors. This makes it simple to check UI alignment, see which elements are taking up unnecessary space, or track down elements that may not be behaving as expected. Overall, the new Plugin.Maui.DebugRainbows is a great plugin that allows .NET MAUI developers to create stunning UI, down to every pixel.
Text-to-Speech in .NET MAUI
.NET MAUI is built to enable .NET developers to create cross-platform apps for Android, iOS, macOS, and Windows with deep native integrations, platform-based UI, and hybrid environments that extend the reach of Blazor/JS web UI technologies. Modern mobile/desktop apps should strive to increase accessibility, and one of the best ways to include low vision users is on most platforms. The text-to-speech feature is great. Fortunately for .NET MAUI developers, enabling text-to-speech functionality doesn’t take much time. Leomaris Reyes I wrote an article about text-to-speech in .NET MAUI.
Leomaris details what .NET MAUI developers need to do to enable text-to-speech functionality. The Microsoft.Maui.Media namespace provides a default implementation of the ITextToSpeech interface. All target platforms of .NET MAUI: iOS, Android, Windows, and macOS support text-to-speech functionality. Developers must leverage the device’s built-in text-to-speech engine to read the provided text aloud. The SpeakAsync method takes a required Text parameter, but optional speech parameters allow developers to further customize the experience, such as pitch, volume, and locale controls.
With easy-to-follow code and examples, Leomaris shows that text-to-speech can be easily implemented in .NET MAUI while addressing some API limitations. This is a great resource for .NET MAUI developers looking to build accessible apps.
From Xamarin to .NET MAUI
.NET MAUI is an evolution of the modern .NET cross-platform development stack, giving developers access to mobile and desktop form factors from a single, shared codebase. However, the current reality for many apps may be Xamarin or Xamarin.Forms. Moving forward requires a migration strategy. David Ortinau I’m going to do a video to take everyone through migrating an app from Xamarin.Forms to .NET MAUI.
May 2024 is when official support for Xamarin and Xamarin.Forms ends. Now is a good time to start migrating to .NET MAUI. David started with the .NET Upgrade Assistant tool. This tool was very helpful in supporting our migration from Xamarin to .NET MAUI. Today’s tools handle configuration updates to SDK-style projects, remapping namespaces, replacing dependencies, and suggesting code changes for maximum reuse of C#/XAML code between Xamarin and .NET MAUI. The real benefits of moving to .NET MAUI are a single, truly shared project, reusable assets, dependency injection, and increased platform reach.
For those upgrading manually, David pointed out solid documentation, compatibility support, and a wealth of community resources to help developers evolve their apps. As time goes by, there is a lot of help and encouragement for upgrading from Xamarin to .NET MAUI.
Blazor hybrid app
Gone Mobile is a long-running and popular podcast that has evolved over time. hosted by Jonathan Dick and alan rich, Gone Mobile covers all things mobile development, including .NET MAUI in particular, and details cross-platform development, design and marketing topics for mobile apps. The latest episode will be a great read for any .NET MAUI developer to hear all about Blazor hybrid apps with .NET MAUI.
In this episode, Jon and Allan discuss the promise of Blazor within .NET MAUI apps: the opportunity to leverage native platform APIs, as well as performance considerations and compatibility issues with various platforms. The talk explores the architecture of Blazor Hybrid apps and acknowledges the potential for code reuse across web/native apps. Cross-platform app development has never been easier. Mixing and matching Blazor and .NET MAUI promises an ecosystem that promotes code reuse and increases developer productivity.
AI with .NET
We are now in the era of artificial intelligence (AI). AI is slowly changing the way we live and work, and its popularity is accelerating its adoption in enterprise and consumer apps. AI provides .NET developers with tremendous opportunities to infuse generative AI and Large Language Model (LLM)-based solutions into their apps. .NET 8 brings many benefits to developers: Jordan Mathisen I point out. Introducing the AI ​​Quickstart for .NET developers.
There is a lot of content for .NET developers to learn key concepts such as Getting Started with OpenAI with .NET, AI Perfection, Prompt Engineering, and ChatGPT Integration. With the new quickstart, developers have a fully integrated example leveraging OpenAI’s LLM for exciting scenarios such as summarizing text, building chat apps, and creating images.
Each quickstart guide guides developers step-by-step through code to achieve a specific AI task. Most use the Azure OpenAI SDK with more samples to come. AI is taking over the world, and developers, including .NET MAUI developers, can start exploring AI using modern .NET.
That’s it for now.
See you next week with more great content related to .NET MAUI.
Cheers, developers!