Taming the Microsoft .NET MAUI Beast for Multiplatform App Development
Introduction
This article aims to be accessible to a non-technical audience, so a modest effort is made to lay the foundation for understanding important concepts and terms. With regard to .NET MAUI, let's start by clarifying the .NET technology and the acronym MAUI.
Developed by Microsoft, .NET [1] is a free, open-source, cross-platform framework and provides a programming model, a comprehensive library, and runtime for building Windows, Web, Cloud, Mobile, Gaming, and IoT (Internet of Things) applications. The introduction of .NET 5 and .NET 6 from November 2020 marked a significant shift, unifying the previously separate .NET Core and .NET Framework into a single platform.
.NET MAUI [2], has its root in the Xamarin platform [3]. Xamarin, as a company was founded in 2011, and later acquired by Microsoft in 2016. As a design platform, Xamarin gained popularity for allowing developers to write code in the C# .NET programming language and share a substantial portion of it across Android, iOS, and Windows platforms. Today, Xamarin and .NET MAUI are therefore part of the evolution of cross-platform mobile app development within the .NET ecosystem, with .NET MAUI set to replace or already replacing Xamarin.
Overview of the Challenges
At the heart of .NET MAUI lies the ambitious goal of unifying diverse native user interfaces under one umbrella. This inherent complexity stems from the need to seamlessly integrate Android, iOS, macOS, and Windows UI (WinUI) elements. That is, unifying the native user interfaces (specific to Android, iOS, macOS, WinUI) indeed presents immense challenges in the design, tooling, performance optimizations, and so on.
Two years into this journey, it's clear that this is no small feat, and the initial learning curve can be steep. In retrospect, embarking on the journey of programming multiplatform apps with .NET MAUI is akin to taming a complex beast, hence the article title.
Two years ago, I embraced the challenge, and after overcoming numerous hurdles and implementing creative workarounds, I can finally say I've crafted a satisfactorily working app that paves the way for any future designs. In this article, I will highlight the challenges encountered and the overall experience of navigating the intricate landscape of the .NET MAUI framework.
Platform Discrepancies
Each platform has its own set of guidelines, design principles, and UI components both in hardware and software. Bridging the gap between them requires careful consideration and often necessitates platform-specific code. This, in fact, is the core mission of the Microsoft .NET MAUI project!
To appreciate this, it would help to ponder, what if in the early 1980s both IBM PC (with Intel 8088 CPU) and Apple Macintosh (with Motorola 68000 CPU) adapted the same processor and Operating System (OS). Oh!, I can also hear those dissenting voices arguing that such standardization could stifle innovation. After all, personal computing technologies have historically taken diverse paths.
The landscape of technological divergence was poised for remarkable growth, fundamentally shaping our present world. Notably, the advent of smartphone technologies, led by the Apple iPhone in 2007 and Google Android in 2008, played a pivotal role in this transformative evolution. Microsoft entered the market later, making its presence known in 2010 and intensifying efforts in 2015 with mobile devices running Windows 10 OS. However, as a latecomer, Microsoft struggled to maintain competitiveness in the smartphone market, ultimately announcing the cessation of active development and support for Windows 10 Mobile in 2017. On a personal note, I still miss my Microsoft Lumia 950 XL smartphone [4], that I dare label "the world's best smartphone that never gained its due acclaim".
From the user's perspective, there is no doubt that the smartphone has become an essential tool that we cannot do without today, and it is poised to remain a crucial device in the future. The continuous growth of app stores further enhances the functionality of this indispensable gadget.
Think of the software developers, too. Wouldn't it be great to write code once and run on all smartphones, and desktops, too?
In the realm of software development, one can envisage the potential of writing code just once and effortlessly executing it across various smartphones and desktop devices. This is the core concept behind the NET MAUI vision.
.NET MAUI is currently addressing the intricate challenges arising from the divergent paths established in the early 1980s with personal computing, and the subsequent emergence of smartphones in the 2000s. These technologies, operating on various CPUs, OSs, and associated APIs (Application Programming Interfaces), have created a complex landscape. Acknowledging this historical context helps underscore the formidable challenges being tackled by .NET MAUI.
Tooling and Documentation
As with any evolving framework, .NET MAUI has undergone changes over the past two years. Navigating through evolving documentation and adapting to updates in tooling has been a consistent challenge. Especially, the ever-evolving landscape of .NET versions has been a formidable challenge.
The .NET MAUI journey began with version 6.0, and over the course of two years, the framework has witnessed significant updates with each subsequent release. The dynamic nature of successive .NET versions introduced a level of instability into the development process. Features that were stable in one version might undergo changes in the next, requiring constant vigilance and adaptation. Navigating the transition from one version to another introduced challenges, as APIs evolved, and new features were introduced. At times, going back to the preceding version was necessary due to regressive as well as new bugs being introduced into new version.
Keeping pace with changes in development environments, SDKs (software development kits), and toolsets added another layer of complexity to the development process. With the framework's evolution from .NET 5.0 to the present .NET 8.0, the journey has been marked by continual adaptation and refinement.
On the tooling side, the version updates of Visual Studio 2022 (for production release .NET) [5] and Visual Studio 2022 Preview (for .NET under-development)—as the preferred Integrated Design Environment (IDE)—also played a crucial role in shaping the development landscape for .NET MAUI, just as the .NET framework updates do. While each version of Visual Studio brings improvements to the development environment, these enhancements contribute to a more efficient development experience and performance gains but, unfortunately, not without issues which may be regressive or entirely new issues. On one occasion, I had to give up on Visual Studio 2022 Preview for several months because a trivial bug [6] broke the usability of the IDE. As a preview (not a production release) this IDE didn’t get a priority fix – it took over four months to fix [7] what appeared to be a trivial problem.
For me, it was only over the recent six weeks or so that a reasonable design stability versus performance gain were satisfactorily achieved with .NET 8.0. This has enabled me to share my experiences through this article.
Performance Optimization
Achieving optimal performance in any software development involves implementing various strategies and best practices. Designing with .NET MAUI and achieving optimal performance across multiple platforms demands even more—a deep understanding of the complex underlying technologies encompassing different platforms.
Balancing performance without compromising on user experience is a delicate balance. Achieving optimal performance with .NET MAUI involves implementing various strategies and best practices.
A Real .NET MAUI Design
Embarking on the intricate journey of designing with .NET MAUI, I have opted to showcase the process through an app seamlessly blending database functionality and multiple API integrations. Drawing from my extensive experience as a productivity tools enthusiast (often as an early adapter) since the early 2000s, I've identified a longstanding gap in the Personal Information Management (PIM) landscape. My quest for productivity tools began in the early 2000s with devices like the Compaq/HP iPAQ PDA [8], and software solutions such as PhatNotes and SPB Wallet Information Manager. Despite my continuous exploration of these tools, none seemed to fully meet my comprehensive PIM needs.
Seizing this chance, I introduce a business and personal information management app I call "My Data Wallet" [9]—not only as a testament to .NET MAUI's capabilities but also as a tailored solution to fulfil my PIM needs.
This app project diverges from the conventional enterprise design model, where collaborative efforts between designers and developers are the norm for crafting a seamless and efficient user experience. The uniqueness of this endeavour lies in its distinctive nature, gravitating more towards a proof-of-concept exploration within the realm of a new framework. Given the project's singular characteristics, I assumed a dual role, spearheading both the design and developer tasks with the assistance of junior associates taking on supportive roles under my guidance.
Overview of the App Features
The detailed features of "My Data Wallet" or MDW app are outlined extensively on the Google Play Store. However, for the purpose of emphasizing the comprehensive design that seamlessly integrates various APIs, and to provide insight into noteworthy challenges, inventive workarounds, and overall hurdles encountered in the .NET MAUI design workflow, here is a condensed summary.
App Features: you can consider each feature as an app in its own right
User Experience Features: these make the app more efficient, intuitive, user-friendly, and enhance its overall usability.
Main Design Components: .NET MAUI components used to build
The preceding summaries offer insights into the intricate and expansive workflows involved in the design and development process. The app features serve as a testament to the app's versatility, catering to a wide range of PIM tasks. With current production release, the app size is circa 60 MB, a notable achievement considering it was developed with net8.0 and significantly reduced from over 100 MB with previous .NET versions.
While the current app demonstrates efficiency, there exists ample opportunity for further optimization in both app size and performance. MDW app stands as an ongoing project poised for continuous improvement.
Having established the real design scenario in above, let's now move on to providing a brief overview of the real challenges and the inventive workarounds. It's important to note that a comprehensive exploration of these challenges would extend into lengthy articles, much like the one you are currently reading.
Overview of Challenges and Workarounds
Before discussing an overview of challenges and the creative solutions devised to address them, it's heartening to note that the .NET MAUI design and development process is not a solitary endeavour. The active engagement of the developer community plays a crucial role in alleviating these challenges, fostering a collaborative and supportive environment.
The .NET MAUI Community Toolkit [11] serves as the mother of all collective packages. It is widely used for utilities such as animations, sharing utilities, playing a pivotal role in substantially easing the design process with well-targeted solutions. Additionally, specialized NuGet packages contributed by individual developers are utilized and duly acknowledged and contribute to the overall richness of the development ecosystem.
Overview of Challenges
As mentioned earlier, overseeing both design and development tasks appear to be a reflection of the 80/20 rule of the Pareto principle [12], particularly in terms of time allocation between UI design and business logic-oriented programming. In the context of the Model-View-ViewModel (MVVM) [13] design pattern, a substantial proportion of effort is dedicated to the "View" component, responsible for the User Interface (UI)—essentially, what the user observes on the screen. This is unsurprising, given that, as emphasized in preceding sections, the challenges of multiplatform development stem from the inherent differences among native platforms.
Cataloguing the exhaustive array of issues encountered in this project becomes a daunting task unless one is discerning with the choice of representative issues. The comprehensive documentation on GitHub underscores the sheer volume and dynamic nature of the issues. Presently, there are nearly 3000 open or active .NET MAUI issues [14], while over the project's lifetime, more than 7400 issues have been successfully resolved or completed. In light of these extensive numbers, with regard to this project, I will provide a succinct summary highlighting selected issues of notable significance.
AppShell Issues:
The AppShell serves as the primary container for the application's user interface, establishing the overall structure and navigation flow. While conceptually elegant, its practical implementation encounters several challenges, with varying degrees of complexity across different platforms. A notable feature in Xamarin, the TabbedPage, currently faces compatibility issues with .NET MAUI. However, it's important to note that this situation may evolve in the future, with anticipated changes or updates potentially resolving the current incompatibility.
It's worth noting that these workarounds, including various others applied elsewhere, may become obsolete as the identified issues are resolved in future updates.
CollectionView Issues:
The CollectionView list control is a powerful tool for versatile list implementation of the MDW app, demonstrating seamless functionality with Android with the latest update. However, its performance is not as flawless when dealing with iOS and WinUI, presenting challenges that need attention and resolution on those platforms.
Layout Issues:
Dealing with layout issues, including positioning and filling container controls, has been a consistent challenge, necessitating adjustments that used to work seamlessly in Xamarin.
Handlers could be the game changer!
While dealing with challenges and workarounds, it's essential to be up to date with emerging strategies in development with the potential to significantly reduce these obstacles. A particularly exciting design methodology gaining momentum is the use of Handlers [16].
The .NET MAUI Design Odyssey
Surveying global sentiments, it becomes evident that the collective journey of the developer community in relation to .NET MAUI is akin to navigating through turbulent waters. Indeed, embarking on the ambitious journey of .NET MAUI proves to be a formidable challenge, invoking a wave of frustration within the developer community.
Opinions echoing this discontent bear titles ranging from sceptical inquiries like "Is MAUI dead on arrival?" to more critical assessments such as "Is MAUI mature enough for enterprise-grade native application deployment?" Some even go so far as to dub MAUI as nothing more than a "SCAM." While these extreme claims may be unwarranted and lack justification, they serve as an exaggerated reflection of the genuine frustrations prevailing in the developer landscape. This discontent, albeit intense at times, serves as a meaningful barometer gauging the true challenges faced by .NET MAUI.
Conclusions
Taming .NET MAUI is undeniably a formidable challenge, but the journey is marked by valuable learning experiences and rewards. As the framework continues to evolve, the development community will play a crucial role in shaping its future. Navigating through the complexities, embracing creativity in problem-solving, and actively participating in the community are the keys to unlocking the full potential of .NET MAUI for multiplatform app development. Notable community engagements include the .NET MAUI’s GitHub project site [17] for raising, tracking, and discussing issues; the .NET MAUI Community Toolkit's GitHub project site [18]; and the Microsoft Learn site [19], for asking and answering questions on anything Microsoft, including .NET MAUI.
Navigating the evolution of .NET MAUI from version 6.0 to the recent stability of .NET 8.0 has been a journey marked by resilience and adaptability. The challenges posed by version transitions have been met with determination, community collaboration, and a commitment to staying abreast of the evolving landscape. As stability becomes a constant, the .NET MAUI development community can now focus on leveraging the full potential of the framework to create robust, multiplatform applications.
Visual Studio 2022 and its Preview version (supporting the latest .NET in development phase, currently net8.0) are integral components of the .NET MAUI development ecosystem. The updates they bring, including tooling enhancements, template improvements, compatibility, and bug fixes, significantly impact the overall experience of building cross-platform applications with .NET MAUI. Developers are encouraged to stay abreast of the latest Visual Studio updates to take full advantage of the evolving capabilities in both the IDE and the .NET MAUI framework.
.NET MAUI simplifies multiplatform integration, offering a solution to complex challenges. Mastering design and development strategies leads to the clear benefit of writing code once and targeting multiple platforms, expanding app reach across diverse markets. Currently, the Android platform is released, and the Windows version is in the Alpha stage, with minor issues like SwipeView and AppShell TabBar on Android requiring creative workarounds. The parallel design of WinUI streamlines development, leveraging its native desktop convenience for prototyping in XAML with HotReload, minimizing reliance on Android emulators. iOS implementation is progressing, with focused attention on completion.
Finally...
A credit where it’s due for this amazing technology: a heartfelt expression of gratitude is extended to the Xamarin team for their visionary approach, in uniting developers within a collaborative framework rather than the segmented coding landscape that would otherwise be the case. Special appreciation is also extended to Microsoft for transforming the ambitious .NET MAUI project from concept to reality on a grand scale. The collective efforts of both teams have not only bridged gaps in development but have also significantly shaped and realized the expansive potential of the .NET MAUI framework.
Finally, finally...
I wanted to take a moment to address the challenges we've encountered in our project timeline due to complexities associated with .NET MAUI. The intricacies of the framework have led to unforeseen delays, and my company and I sincerely apologize for any inconvenience this may have caused to our investors. In particular, I would like to extend my gratitude to BA for the invaluable assistance provided during the project, especially in facilitating the acquisition of high-powered computing resources that .NET MAUI design environment demands. Your unwavering support and patience have been instrumental in overcoming obstacles, and I genuinely appreciate your commitment to our collective success.
To AI, DR, FB, GF, HA, NG, ST, and TM, I want to express my sincere thanks for your understanding and patience throughout this process. Your continued support has been crucial, and I am confident that the benefits we are poised to reap from the implementation of .NET MAUI will make the wait worthwhile. Thank you for your ongoing commitment to our shared goals. I am optimistic about the positive outcomes ahead, and I appreciate your continued trust in our endeavours.
Postscript: A free version of MDW app is available for Ethiopia here at Google Play store [20].
If you've got this far, chances are you may have found this article useful. If so, show your appreciation by voting with thumbs-up icon shown at the bottom of this page so that I get a more realistic indication of readers interest in what I share.
References
Assoc. Prof. of Electronics & Computer Engineering|SMIEEE|VLSI Design |Micro-Nano Electronics| Computer Vision|Image Processing|Human Robots Interactions
1yIt is awesome. Your presentation is very attractive and winning readers heart. I didn't break from reading for a while, it was like suspense film. It is so insightful and teaching lesson. Even though I am naive to . Net framework development, I learned a lot from technology breakthrough, .NET MAUI. I will continue learning the .NET MAUI and try to make part of my MS Kinect based project. Thank you so much for sharing. 'Nuuf Jiraadha!'
Research Fellow
1yThank you Demissie for sharing with us the complex takes undertaken for the development of My Wallet .Your article made it easy for a lay person to appreciate the utility of the product and the effort made to make it happen. You trail blazer in presenting complex technology accessible to the end user and I hope other developers will follow suit
Software guy @ Anodyne Systems Pty Ltd 🇺🇦 🇪🇪 🇦🇺
1yThanks for this great summary of your project and the overview of .NET MAUI, it's nice to see a realistic/more positive assessment of the technology by someone who has actually used it to make a real application.
Agricultural Economist. Teaching is the most rewarding job as teachers create intelligent minds. R&D is at the center of human civilization.
1yDear Dr Demissie. Congratulations for this successful journey! The article you presented here really walks a non-professional /laymen to the field, through a vast and extensive world of the IT. Thank you for sharing this extraordinary story of "Taming the. NET MAUI.....". a story of human ingenuinity in exploring science and technology, for innovation towards a betterment of human welfare. I started using MDW and found it awesome in managing personal information. 👏👏👏