1. What is .NET MAUI
.NET MAUI is the next generation of Xamarin.Forms, Microsoft's latest cross platform offering. .NET MAUI is the evolution of Xamain.Forms toolkit.
Highlights of .NET MAUI
- Cross Platform, Native UI
- Single Project, Single Codebase
- Deploy to multiple devices, mobile & desktop
2. Evolution of .NET MAUI
.NET MAUI is the successor of Xamarin.Forms . Xamarin is a software company founded in 2011 by the engineers behind Mono, Xamarin.Android and Xamarin.IOS . In 2016 Xamarin has been acquired by Microsoft.
Latest version of Xamarin.Forms, which is 5.0 released in 2021.
The next version of Xamarin.Forms is based on .NET 6. Its been announced that the next version of Xamarin.Forms is going to be .NET MAUI
3. Current state
Currently .NET MAUI is in Preview 4. Check out the official release announcement.
4. Installation of .NET MAUI Check Tool
Run the following terminal command to install .NET MAUI Check Tool
dotnet tool install -g redth.net.maui.check
On successful installation of tool you can see the message following message on your terminal.
You can invoke the tool using the following command: maui-check Tool 'redth.net.maui.check' (version '0.5.0') was successfully installed.
Once installation is done, run the following terminal command to install all pre-requisites required for .NET MAUI development
Tool will check for
- OpenJdk / AndroidSDK
- .NET 6 Preview SDK
- .NET MAUI Templates
Whenever tool prompt to "Attempt to fix?", type 'y' to continue. Screen shots show various stages of tool checking pre-requisites
After successful installation, tool shows following message. Press enter to exit.
5. Get started with official samples
Connect your Android device in your PC or Launch Android Emulator before start.
Clone official .net maui samples repository
Navigate to cloned path in your pc using command prompt
To build Android project:
dotnet build HelloAndroid
To run Android project:
dotnet build HelloAndroid -t:Run
To launch .NET MAUI Project
dotnet build HelloMaui -t:Run -f net6.0-android
6. Get started with Visual Studio 2019 Preview
Make sure you have latest preview installed on your PC.
Before running the code, do nuget package addition in visual studio. Create a nuget.config file to the root of your project and add the following feed(s) with these commands:
dotnet new nugetconfig
dotnet nuget add source -n maui-preview https://aka.ms/maui-preview/index.json
In visual studio change target to android, hit F5 run in local device or Emulator
✌️ Your first MAUI App is up and running.
7. Battery Charge Indicator Sample Application for Android
I have created a MAUI application which shows the current battery charge percentage and source of power in an android device.
Check sample application created in Github.
8. 🚀 What Is Next?
Please check out the official roadmap
Top comments (2)
I have created a MAUI project in VS 2022 preview, which is working fine initially with emulator, but now Emulator is not showing. When I create Xamarin project Emulator is showing and application is running on that Emulator.
Please help me to resolve this issue as it occurs developing application
What I have tried:
I had delete/renamed
I had repair VS 2022 preview
I had reinstall MAUI
Sorry for the late replay.
I have created the above using VS 2019 Preview. I'm not sure whether VS 2022 Preview is stable for xamarin devs. I need to check on this and will revert u.