当前位置:网站首页>Maui's way of learning -- Opening
Maui's way of learning -- Opening
2022-06-24 10:51:00 【Dotnet cross platform】
Maui The way of learning -- The opening
After thinking for a long time, I decided to send one Maui Introduction as the opening , Although this is an old topic , But we can't do without such discussion ( Please allow me an article ).
What is? .NET Maui
.NET Maui It is a Microsoft product based on .Net Multi-platform application UI (.NET MAUI) Cross platform framework for , Use C# and XAML Create native mobile and desktop apps , Use .NET MAUI, Can be developed from a single shared code base in Android、iOS、macOS and Windows Applications running on .
.NET Maui Born out of Xamarin.Forms, If there is Xamarin.Forms Using experience of , that Maui Will become very handy . Use .NET MAUI, You can use a single project to create multi platform applications , But if necessary , You can add platform specific source code and resources ..NET MAUI The main goal of is to achieve as much application logic and... As possible in a single code base UI Layout .

.NET Maui Supported platforms
Android 5.0Or later (API 21)iOS 10Or later (UIKit)macOS 10.13Or later (Mac CatalystUIKit)Windows 11andWindows 10(1809) Or later (WinUI3WindowsAppSdk)Tizen, Supported by Samsung ( It has been integrated into the project template )Linux, Supported by the community
.NET Maui How it works
.NET MAUI take Android、iOS、macOS and Windows API Unified into a single API in , The API Allow any developer experience to be written and run at once , It also provides in-depth access to all aspects of each native platform .
.NET 6 Provides a series of platform specific frameworks to create applications :.NET for Android、.NET for iOS、.NET for macOS as well as Windows UI 3 (WinUI 3) library . These frameworks all have access to the same .NET 6 Base class library (BCL) . This library abstracts the details of the underlying platform from the code .BCL Depend on .NET Runtime , Provide execution environment for code .
about Android、iOS and macOS, The environment consists of Mono Realization , This is a .NET Runtime implementation . stay Windows,Win32 Provide an execution environment .
although BCL Enable applications running on different platforms to share common business logic , But various platforms have different ways of defining user interfaces for applications , And they provide different models , Used to specify how user interface elements communicate and interoperate . Can be used for Android、iOS、macOS、WinUI 3 Of .Net Create separate for each platform UI, But this approach requires maintaining a code base for each individual equipment family ..NET MAUI Provides a framework , For building... For mobile and desktop applications UI.
The image below shows .NET MAUI Advanced view of Applied Architecture :

stay .NET MAUI Application , The compilation is mainly related to .NET MAUI API Interactive code ,NET MAUI Use the native platform directly API. In addition, the application code can directly use the platform as required API.
.NET MAUI Applications can be found in Window PC or Mac Write on ( At present, we need to use vs2022 preview), And compile it into a native application package :
AndroidUse.NET MAUICompiled application fromC#Compile to intermediate language (IL), And then when the app starts (JIT) Compile to native assembly .iOSUse.NET MAUIThe compiled application is completely native compiled ( fromC#Compile as nativeARMAssembly codeAOT) .macOSUse.NET MAUICompiled applications useMac Catalyst, This is aAppleA solution provided , It will useUIKitGeneratediOSThe application is introduced into the desktop , And use other... As neededAppKitAnd the platformAPIExpand it .WindowsUse.NET MAUIThe generated application usesWindows UI 3(WinUI 3) Library to createWindowsDesktop native applications .
.NET Maui Other applications of
although .NET Maui Encapsulation of controls native to each platform has been provided , But you can still use Maui The provided self drawing engine draws controls that meet your own needs (
Microsoft.Maui.Graphics)You can also create
.NET MAUI Blazorapplication , To achieve the same experience as the web page ,.NET MAUI BlazorApplications also need to be updated for platform specificWebViewControl , The current support platforms are as follows :Android 7.0(API 24) Or later (Chrome)iOS 14Or later (Safari)Mac Catalyst macOS 11Or later (Safari)indows 11、Windows 10(1809) Or later (Edge webview2)Tizen( Unknown )Linux( Unknown )
.NET Maui Develop the technical knowledge that needs to be learned :
Basics :
.NETC#XamlMaui
Expand :
Winui3 apias well asWindowsplatformApi(Windows)Android api(Android)( Usually you don't need , If you need to call some hardware )UIKit,iOSplatformapi(iOS)( Usually you don't need , If you need to call some hardware )UIKit,Appkit,MacOS api(Mac)Blazor( It's not necessary )
.NET Maui Advantages and disadvantages
advantage :
Use
C#+.NetDevelopment , Easy to get started , It's easy to upgrade , Cooperate with the universe first IDE Work efficiency is not the sameMicrosoft's technologies basically have something in common ( You can easily switch to
WPF)Big factory guarantee
Use platform controls on different platforms , Ensure native performance
coordination
BlazorIt can realize the consistent experience with the web side
shortcoming :
I won't support it
win7, Even pickwin10Version ofAlthough officially released, it is still not stable
the reason being that
C#So maybe not as good asjavaIt is so easy to find a satisfying job in the system or front-end ( Big factories are generallyjava)Microsoft likes hacking
Although guaranteed to be native , But that means you need to adapt to different platforms ( Non self drawing )
Although guaranteed to be native , This also means that you need to learn about the platform ( Controls also behave differently )( Of course, this is what all cross platform applications need to learn )
Similar cross platform development framework :
QT( UseC++, Personally, I think it is cross platform in the real sense , It even supports embedded systems )( owner-draw )Flutter( Google's cross platform framework , UseDartLanguage )( owner-draw )Uno platform(C#The implementation is similar toMaui)Avalonia(C#classWPF)( owner-draw )CPF(C#Domestic cross platformUIDevelopment framework , Support Loongson )( owner-draw )Electron( Web technology stack direction )
Related learning Links :
Maui:.NET Multi-platform application UI file - .NET MAUI | Microsoft Docs [1]C# Platform call: Platform call (P/Invoke) | Microsoft Docs[2]Windows Api: pinvoke.net: memcpy (msvcrt)[3]WinUI3: Create the first one WinUI 3(Windows application SDK) project - Windows apps | Microsoft Docs[4]UIKIT:UIKit Namespace | Microsoft Docs [5]AppKit: AppKit Namespace | Microsoft Docs[6]Community ToolKit: Use .NET Multi-platform application UI (.NET MAUI) Community Toolkit introduction - .NET Community Toolkit | Microsoft Docs [7]
Reference material
[1]
.NET Multi-platform application UI file - .NET MAUI | Microsoft Docs : https://docs.microsoft.com/zh-cn/dotnet/maui/
[2]Platform call (P/Invoke) | Microsoft Docs: https://docs.microsoft.com/zh-cn/dotnet/standard/native-interop/pinvoke
[3]pinvoke.net: memcpy (msvcrt): https://www.pinvoke.net/default.aspx/msvcrt/memcpy.html
[4]Create the first one WinUI 3(Windows application SDK) project - Windows apps | Microsoft Docs: https://docs.microsoft.com/zh-cn/windows/apps/winui/winui3/create-your-first-winui3-app
[5]UIKit Namespace | Microsoft Docs : https://docs.microsoft.com/zh-cn/dotnet/api/uikit?view=xamarin-ios-sdk-12
[6]AppKit Namespace | Microsoft Docs: https://docs.microsoft.com/zh-cn/dotnet/api/appkit?view=xamarin-mac-sdk-14
[7]Use .NET Multi-platform application UI (.NET MAUI) Community Toolkit introduction - .NET Community Toolkit | Microsoft Docs : https://docs.microsoft.com/zh-cn/dotnet/communitytoolkit/maui/get-started
边栏推荐
- SF Technology Smart logistics Campus Technology Challenge (June 19, 2022) [AK]
- SQL Server about like operator (including the problem of field data automatically filling in spaces)
- Smart energy: scenario application of intelligent security monitoring technology easycvr in the petroleum energy industry
- What is wireless WiFi? What are the benefits of wireless WiFi
- Spark提交参数--files的使用
- 126. word Solitaire II BFS
- Petit guide de construction rapide du bras mécanique (II): application du bras mécanique
- Detailed explanation of SQL Sever basic data types
- Quick completion guide for mechanical arm (II): application of mechanical arm
- Suddenly I thought of the wooden house in my hometown
猜你喜欢

【IEEE出版】2022年自然语言处理与信息检索国际会议(ECNLPIR 2022)

喜歡就去行動

26.删除有序数组的重复项

多线程的应用 - 提升效率

Petit guide de construction rapide du bras mécanique (II): application du bras mécanique

机械臂速成小指南(一):机械臂发展概况

Thread operation principle

【Energy Reports期刊发表】2022年能源与环境工程国际会议(CFEEE 2022)

2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)

24. image mosaic operation
随机推荐
线程运行原理
Stack Title: exclusive time of function
Process and multithreading
Thread pool execution process
What is the knowledge map? What does it do
[IEEE publication] International Conference on natural language processing and information retrieval in 2022 (ecnlpir 2022)
How to use multiple kindeditor editors on a page and pass values to the server
24. image mosaic operation
splice()方法的使用介绍
Niuke-top101-bm28
Image click enlargement and adaptive size in the applet rich text
Stack Title: fractions in parentheses
Sort out interface performance optimization skills and kill slow code
抓包工具charles实践分享
What is wireless WiFi? What are the benefits of wireless WiFi
Window function row in SQL Server_ number()rank()dense_ rank()
2022年能源与环境工程国际研讨会(CoEEE 2022)
Plant growth H5 animation JS special effect
The latest entry date of SQL Sever test questions
2022 the most complete and detailed JMeter interface test tutorial and detailed interface test process in the whole network - JMeter test plan component (thread < user >)