.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML.It is the evolution of the Xamarin.Forms cross-platform framework. .NET MAUI Release Candidate 2 was made available on April 26, 2022. This means that it is supported by Microsoft for production apps.
I shall demonstrate how easy it is to get started with.NET MAUI on macOS. In order to follow on, you will need the following pre-requisites:
- You need a macOS computer with either the x64 or M1 chips
- Install Xcode 13.2 (or later)
- Download & install Android Studio
- Install .NET MAUI on macOS by following these instructions
- If you do not already have VS Code, download and install it
Getting Started
dotnet new --list
This should will show you the available .NET application templates for cross platform applications:
Template | Short Name |
---|---|
.NET MAUI App (Preview) .NET MAUI App (Preview) | maui |
.NET MAUI Blazor App (Preview) | maui-blazor |
.NET MAUI Class Library (Preview) | mauilib |
.NET MAUI ContentPage (C#) (Preview) | maui-page-csharp |
.NET MAUI ContentPage (XAML) (Preview) | maui-page-xaml |
.NET MAUI ContentView (C#) (Preview) | maui-view-csharp |
.NET MAUI ContentView (XAML) (Preview) | maui-view-xaml |
Android Activity template | android-activity |
Android Application (Preview) | android |
Android Class Library (Preview) | androidlib |
Android Java Library Binding (Preview) | android-bindinglib |
Android Layout template | android-layout |
In today's exercise, we will create an app using the first maui template.
On the mac, you will need iOS 15.2 SDK (shipped with Xcode 13.2). If you have multiple versions of Xcode, you can choose a suitable version to be used with MAUI with:
dotnet new maui -o maui2022cd maui2022
net6.0net6.0-androidnet6.0-iosnet6.0-maccatalystnet6.0-macosnet6.0-tvosnet6.0-windows
Run app on macOS
Run app on iOS simulator
Run app in Android emulator
Making a tiny change
Conclusion
- change the picture on the main screen
- change the application icon that appears on the phone
- change the theme color of your app
No comments:
Post a Comment