Microsoft launches .NET MAUI in .NET 8
(14 November 2023)

Other recent news...

Microsoft highlights .NET 8 Hardware Intrinsics features
Additional hardware functionality via APIs so the bespoke web apps we develop can take advantage of users' underlying hardware, e.g. WebAssembly support so that core algorithms can...
11 December 2023
Google launches Gemini AI model
Gemini was designed for flexibility, so it can run on everything from data centres to mobile devices. It's been optimized for three different sizes: Ultra, Pro and Nano (for on-dev...
6 December 2023
Apple launches release candidate versions of iOS 17.2 & iPadOS 17.2
Developing and testing our bespoke Apple iOS apps on beta versions of iOS 17.2 & iPadOS 17.2 allows our app developers to confirm that the apps we develop will work as expected...
5 December 2023
Microsoft launches .NET MAUI in .NET 8
The latest major stable release of .NET MAUI in .NET 8 dropped today allowing app developers to create applications that can run on multiple platforms, such as iOS, Android, Windows, and macOS so cutting-edge bespoke app developers such as New Media Aid can use .NET MAUI to create cross-platform applications for Android, iOS, macOS, and Windows with deep native integrations, platform-native user interfaces, and hybrid experiences that extend the reach of Blazor and other web UI technologies. Today marks the third major release of .NET MAUI in the past 18 months which turns the corner from Microsoft's unifying of the Xamarin platform with .NET into pushing forward .NET as one.

In addition to all theamazing work in the .NET SDK and runtime, Microsoft have laboured with extreme focus on .NET 8 to fix high impact bugs, isolate and resolve memory leaks, improve the accuracy and reliability of hot reload, ease the path for customers upgrading from Xamarin, retain and improve performance at startup and runtime, and so much more.

Overview

.NET MAUI, or .NET Multi-platform App UI, is a modern, cross-platform framework developed by Microsoft for building native applications. It is an evolution of Xamarin.Forms, designed to simplify the process of creating applications that can run on multiple platforms, such as iOS, Android, Windows, and macOS. With .NET MAUI, developers can write code once and deploy it on various platforms, reducing development time and effort.

Key Features

1. Single Codebase for Multiple Platforms:

One of the primary advantages of .NET MAUI is the ability to maintain a single codebase for multiple platforms. Developers can write the majority of their application logic and user interface code once and deploy it on iOS, Android, Windows, and macOS. This promotes code reusability and streamlines the development process.

2. Native Performance:

.NET MAUI applications are compiled to native code, ensuring high performance on each platform. This is achieved through the use of .NET 6 and the latest advancements in the runtime, enabling developers to deliver responsive and efficient applications.

3. Cross-platform UI Components:

.NET MAUI provides a set of cross-platform UI components that adapt to the native look and feel of each platform. This allows developers to create a consistent user experience across different devices while still leveraging the unique features and design patterns of each platform.

4. Support for Desktop Platforms:

In addition to targeting mobile platforms, .NET MAUI extends its support to desktop platforms, including Windows and macOS. This means that developers can build applications that run seamlessly on a wide range of devices, from smartphones and tablets to desktop computers.

5. XAML for UI Definition:

.NET MAUI uses XAML (eXtensible Application Markup Language) for defining user interfaces. XAML allows developers to separate the presentation layer from the application logic, making it easier to design and maintain UI layouts. XAML is a declarative language, enabling a clear separation between the UI and the underlying code.

6. MVU (Model-View-Update) Architecture:

.NET MAUI embraces the MVU architecture, which simplifies state management and application logic. This architecture is particularly beneficial for building reactive and scalable user interfaces, enabling developers to create applications that respond to changes in data and user interactions.

7. .NET 6 Integration:

.NET MAUI is built on top of .NET 6, the latest version of the .NET platform. This integration provides access to the latest features and improvements in the .NET ecosystem, including performance enhancements, language features, and a unified platform for building various types of applications.

Getting Started with .NET MAUI

1. Installation:

To start developing with .NET MAUI, developers need to install the .NET MAUI workload using the .NET CLI. The workload includes the necessary tools and dependencies for building cross-platform applications.

dotnet workload install maui

2. Project Creation:

Creating a new .NET MAUI project is straightforward. Developers can use the following command to generate a new project template:

arduino
dotnet new maui

This command creates a basic .NET MAUI project structure with default files and configurations.

3. Platform-Specific Code:

While .NET MAUI promotes code sharing, there may be scenarios where platform-specific code is necessary. .NET MAUI supports the use of platform-specific code through the dependency injection mechanism. Developers can use dependency injection to inject platform-specific implementations when needed.

4. XAML for UI:

UI layouts in .NET MAUI are defined using XAML, providing a familiar and expressive way to design interfaces. XAML allows developers to describe the visual hierarchy and properties of UI elements in a markup language, facilitating a clean separation between UI and code.

xml
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" BackgroundColor="{DynamicResource PageBackgroundColor}"> <StackLayout> <Label Text="Hello, .NET MAUI!" FontSize="24" /> <Button Text="Click Me" Clicked="OnButtonClick" /> </StackLayout> </ContentPage>

5. Cross-Platform APIs:

.NET MAUI provides a set of cross-platform APIs for common tasks such as file I/O, networking, and device-specific features. These APIs abstract away platform differences, allowing developers to write code that works consistently across all supported platforms.

Advanced Features and Capabilities

1. Hot Reload:

.NET MAUI introduces a Hot Reload feature that enables developers to see the impact of code and UI changes in real-time without restarting the application. This significantly speeds up the development cycle by providing instant feedback during the development process.

2. Blazor Hybrid Apps:

.NET MAUI supports Blazor Hybrid, allowing developers to build hybrid apps that combine native and web technologies. With Blazor Hybrid, developers can use C# and Razor syntax to create interactive web components within their .NET MAUI applications.

3. Customization and Theming:

.NET MAUI applications can be customized and themed to match the visual identity of the target platform. Developers have fine-grained control over the appearance of their applications, ensuring a native and cohesive user experience.

4. Integration with Azure Services:

.NET MAUI seamlessly integrates with Azure services, making it easy for developers to incorporate cloud-based features into their applications. This includes services such as authentication, data storage, and push notifications.

5. Community and Ecosystem:

.NET MAUI benefits from the extensive .NET ecosystem, including libraries, tools, and community support. Developers can leverage existing .NET packages and NuGet packages to enhance the functionality of their applications.

Conclusion

.NET MAUI represents a significant advancement in the world of cross-platform development, providing a powerful and flexible framework for building native applications. With its emphasis on code sharing, native performance, and cross-platform APIs, .NET MAUI streamlines the development process and empowers developers to create high-quality applications for a wide range of devices.

As the .NET MAUI framework continues to evolve, developers can expect ongoing improvements, new features, and enhanced capabilities. Whether you are a seasoned .NET developer or someone looking to enter the world of cross-platform development, .NET MAUI offers a compelling solution for building modern, native applications that run seamlessly across diverse platforms.


more news...