Sands of MAUI: Issue #44

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


This content originally appeared on Telerik Blogs and was authored by Sam Basu

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 looking forward to .NET Multi-platform App UI (MAUI)—the evolution of Xamarin.Forms with .NET 6. Going forward, developers should have much more confidence in the technology stack and tools as .NET MAUI empowers native cross-platform solutions on mobile and desktop.

While it is a long flight until we reach the sands of MAUI, developer excitement is palpable in all the news/content as we tinker and prepare for .NET MAUI. Like the grains of sand, every piece of news/article/video/tutorial/stream contributes towards developer knowledge and we grow a community/ecosystem willing to learn and 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 February 14, 2022:

.NET MAUI Preview 12 Overview

.NET MAUI Preview 12 has been out for a while and brought along wonderful enhancements like Shell and Dependency Injection. However, the .NET MAUI Preview 12 Overview video from James Montemagno will have a long shelf life. James starts out covering the .NET MAUI Preview 12 highlights, but jumps into things that are more fundamental—Dependency Injection and using Constructor Injection with the Xamarin.Forms/.NET MAUI Shell.

James has well-known love for using the Shell as a starting point and the .NET Podcast app is a classic showcase to see it in action in a real world app. James also goes on to demonstrate Constructor Dependency Injection in an easy to understand sample—something that will benefit most .NET MAUI developers going forward.

Maui12

Publish .NET MAUI Apps

Building a mobile app is only half the battle. The other and arguably the more frustrating, error-prone and time-consuming half is pushing our apps to the iOS/Android/Windows App Stores. Gerald Versluis produced a video about publishing .NET MAUI apps, particularly Android apps to the Google Play Store.

Developers have to produce a signed Android App Bundle (AAB) file that can be uploaded to the Store—Gerald explains the nuances of Android Keystore files.

The Keystore, once generated, should not be misplaced and can be used for producing signed app bundles for updates. Thankfully, CLI tooling helps and Visual Studio 2022 allows for adding Publishing details to the .csproj file itself. Gerald also talks about integrating publishing steps into CI/CD build pipelines and provides pointers for iOS/Windows deployments. Armed with knowledge and the right tools, .NET MAUI developers can look ahead at the app publishing part of the lifecycle with much more confidence and be poised for success.

MauiPublish

React in .NET MAUI

The BlazorWebView control in .NET MAUI enables developers to embed Blazor web content inside native mobile/desktop apps. However, BlazorWebView is essentially a wrapper that renders the appropriate modern WebView for the given platform and is impartial to web content. Building web apps with React? Turns out, React is welcome in .NET MAUI apps as well.

Most folks will start their React apps with npx create-react-app—but running React apps needs NodeJS which is not a player in the .NET MAUI world. However, if we do a production build with npm run build, we're asking for all assets to be minified, bundled and be ready for deployment. We could then start up a .NET MAUI Blazor project, copy over the React build artifacts into the wwwroot folder and switch out the Blazor index.html file with the one from React app—a curious developer tried just that. Turns out, 'compiled' React apps work just fine in .NET MAUI through the WebView and custom React components, like those from KendoReact, are welcome as well.

Web technologies, including .NET and JS SPA frameworks, now have an optimized way into native apps and that should provide more options as developers plot application stack modernization with .NET 6 and .NET MAUI.

MauiReact

No Worries in .NET MAUI

Andreas Nesheim wrote up a wonderful article on some of the benefits of .NET MAUI—things that were a big hassle in Xamarin world end up being no brainers in .NET MAUI. Andreas starts out with how we handle Image resizing and manage Splash Screens today—just not fun to cater to each individual platform. .NET MAUI makes things easier with Resizetizer tool built-in and shared Resources of Fonts, Icons and Splash Screens.

Messy .csproj files are a thing of history with clean SDK-style projects in .NET MAUI, making merge conflicts less likely. We are also not limited with .NET Standard 2.0 language dependencies—the latest .NET MAUI project templates use the full power of C# 10, like File-scoped Namespaces and Global Usings.

Most platform-specific initializations or Dependency Injection can be done in MauiProgram.cs itself and it is also much easier to customize UI elements across platforms. .NET MAUI addresses much of the existing developer pain points and promises a better tomorrow for cross-platform .NET development.

MauiNoWorries

Null Pointer Podcast

Gerald Versluis, Mark Allibone and Steven Thewissen host the Null Pointer podcast—an opinionated podcast on development, tech and every day struggles. Daniel Hindrikes was on as guest for a recent Null Pointers podcast episode to talk about all things Blazor—what's happening with Blazor today and what lies ahead tomorrow.

Daniel shared his experiences writing Blazor apps for both client-side using WebAssembly vs server-side over a SignalR bridge. The excitement is palpable with Blazor now being welcome on native mobile/desktop apps, thanks to .NET MAUI, thus enabling lot more code sharing.

While Blazor Hybrid apps may be what's getting the most attention now, there's no love lost for Mobile Blazor Bindings—the experimental way to write native UI across platforms using Blazor/Razor syntax. Blazor is a wonderful story for .NET developers and the future is just getting better.

NullPointer

That's it for now.

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

Cheers, developers!


This content originally appeared on Telerik Blogs and was authored by Sam Basu


Print Share Comment Cite Upload Translate Updates
APA

Sam Basu | Sciencx (2022-02-14T15:03:36+00:00) Sands of MAUI: Issue #44. Retrieved from https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/

MLA
" » Sands of MAUI: Issue #44." Sam Basu | Sciencx - Monday February 14, 2022, https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/
HARVARD
Sam Basu | Sciencx Monday February 14, 2022 » Sands of MAUI: Issue #44., viewed ,<https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/>
VANCOUVER
Sam Basu | Sciencx - » Sands of MAUI: Issue #44. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/
CHICAGO
" » Sands of MAUI: Issue #44." Sam Basu | Sciencx - Accessed . https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/
IEEE
" » Sands of MAUI: Issue #44." Sam Basu | Sciencx [Online]. Available: https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/. [Accessed: ]
rf:citation
» Sands of MAUI: Issue #44 | Sam Basu | Sciencx | https://www.scien.cx/2022/02/14/sands-of-maui-issue-44/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.