neo-6m uno_Uno-統治所有人的平臺

neo-6m uno

First, we should start off with what Uno is and why you should care.

首先,我們應該從Uno是什么以及為什么要關心開始。

As stated on their website, Uno is "The only platform for building native mobile, desktop and WebAssembly apps with C#, XAML from a single codebase. Open source and professionally supported."

如其網站上所述 ,Uno是“唯一的平臺,可通過單一代碼庫使用C#,XAML構建本機移動,桌面和WebAssembly應用程序。開源且受到專業支持。”

這是什么意思? (What does this mean?)

Well if you have any experience (or not) building a mobile app and a subsequent web app, you have essentially had to build both separately, outside of potentially sharing data through an API.

好吧,如果您有(或沒有)構建移動應用程序和后續Web應用程序的經驗,那么除了通過API可能共享數據之外,您實際上必須分別構建兩者。

Before Xamarin, you would even have had to build the iOS and Android apps separately using different languages (Swift/Objective-C and Java/Kotlin respectively). Uno introduces a way to build for iOS, Android, Web, and UWP using shared logic and UI.

在使用Xamarin之前,您甚至不得不使用不同的語言(分別為Swift / Objective-C和Java / Kotlin)分別構建iOS和Android應用程序。 Uno引入了一種使用共享邏輯和UI為iOS,Android,Web和UWP進行構建的方法。

This is huge.

這是巨大的。

Sharing logic between platforms has been the "easy" part for developers. Sharing UI, however, is not. There is a huge difference in UI between Android and iOS and even larger differences between web and mobile. Xamarin.Forms allows us to share UI for Android and iOS but we were still on our own for the web.

平臺之間共享邏輯一直是開發人員的“輕松”部分。 但是,不是共享UI。 Android和iOS之間的UI差異巨大,網絡和移動設備之間的差異甚至更大。 Xamarin.Forms允許我們共享Android和iOS的UI,但在網絡上我們仍然靠自己。

Uno enables you to write the UI once, then, using native controls, deploys native UI look and feel to each of your platforms. This means, you write the same code for a button regardless of the platform the button is for, and the user will see the native button for their platform.

Uno使您可以編寫一次UI,然后使用本機控件將本機UI外觀部署到每個平臺。 這意味著,無論按鈕用于哪個平臺,都為該按鈕編寫相同的代碼,并且用戶將看到其平臺的本機按鈕。

它是如何工作的? (How does it work?)

The Uno Platform works differently depending on what you're building.

Uno平臺的工作方式取決于您所構建的內容。

The platform specific UI is created by taking the visual tree and rendering into what the platform supports:

通過將可視化樹并渲染為平臺支持的內容來創建特定于平臺的UI:

iOS - UI Kit

iOS - UI套件

Android - ViewGroups and Views

Android的 - ViewGroups和視圖

Web - Native controls

網絡 -本地控制

The logic is also deployed differently for each platform.

每個平臺的邏輯部署也不同。

When building a UWP app, Uno runs on top of, well, UWP and WinUI. When building Android and iOS apps, Uno runs on top of the Xamarin Native Stack. Finally, when you're building a Web App, Uno runs on top of WebAssembly. The mobile apps and web apps all run with Mono runtime. When it all comes together, it looks a little like this:

在構建UWP應用時,Uno可以運行在UWP和WinUI之上。 在構建Android和iOS應用程序時,Uno在Xamarin本機堆棧的頂部運行。 最后,當您構建Web應用程序時,Uno在WebAssembly之上運行。 移動應用程序和Web應用程序均與Mono運行時一起運行。 當所有這些放在一起時,看起來有點像這樣:

Well this looks nice, but what's really happening under the hood?

好吧,這看起來不錯,但是引擎蓋下到底發生了什么呢?

讓我們分解一下: (Let's break it down:)

Android and iOS

Android和iOS

  1. You write your C# and XAML code in Visual Studio

    您在Visual Studio中編寫C#和XAML代碼
  2. Uno takes the code and lets you add any Xamarin specific libraries or tools

    Uno獲取代碼,并允許您添加任何Xamarin特定的庫或工具
  3. Mono runtime executes the C# code

    Mono運行時執行C#代碼

This process is essentially the same as regular Xamarin. The big difference between Xamarin and Uno comes with the ability to run the same UI on the Web.

此過程與常規Xamarin基本相同。 Xamarin和Uno之間的最大區別在于可以在Web上運行相同的UI。

Web Apps -

網絡應用 -

  1. You reuse both your logic and UI ?that you wrote for your mobile apps.

    您可以重用為移動應用程序編寫的邏輯UI

  2. Uno uses the Web Assembly Bootstrapper to take any .NET standard library and execute these files in the JavaScript console.

    Uno使用Web Assembly Bootstrapper來獲取任何.NET標準庫并在JavaScript控制臺中執行這些文件。

  3. Mono runtime then executes the code

    然后,Mono運行時執行代碼

The ability for Uno to utilize Web Assembly (which is what allows you to write your code in C# and not JavaScript) is what makes Uno so unique.

Uno能夠利用Web Assembly(這是使您可以用C#而不是JavaScript編寫代碼的能力)的能力使Uno如此獨特。

UWP -

UWP-

  1. You reuse both your logic and UI ?that you wrote for your mobile apps and Web Assembly Apps.

    您可以重用為移動應用程序和Web Assembly Apps編寫的邏輯UI

  2. Your code is run through the Windows UI which does not need the Mono runtime to execute.

    您的代碼是通過Windows UI運行的,不需要執行Mono運行時。

The big difference here is that UWP apps already have the Windows namespaces and do not need to reference the Uno.UI. The benefit Uno provides here is the ability to reuse the code you've already written for mobile and web.

這里的最大區別是UWP應用程序已經具有Windows名稱空間,并且不需要引用Uno.UI。 Uno在此提供的好處是可以重用您已經為移動設備和Web編寫的代碼。

Now that we have an idea of how this beauty works, let's write some code!

現在我們已經了解了這種美的原理,讓我們編寫一些代碼!

To get started with Uno, follow their instructions here.

要開始使用Uno,請按照此處的說明進行操作。

When you create your Uno solution in Visual Studio, there is a similar feel to when you create a Xamarin.Forms solution because of the different projects created for you. Here is a look at the projects that are auto-created:

在Visual Studio中創建Uno解決方案時,由于為您創建了不同的項目,因此與創建Xamarin.Forms解決方案時的感覺相似。 看一下自動創建的項目:

As you would see in a Xamarin.Forms project, there are separate projects for each platform and a single shared project. The Droid, iOS, UWP, and Wasm projects are all the same as if you had created a blank app for each, the only difference being references to the Uno UI. The magic happens in the Shared project.

正如您在Xamarin.Forms項目中看到的那樣,每個平臺都有單獨的項目,而單個共享項目也有。 Droid,iOS,UWP和Wasm項目與您為每個項目創建一個空白應用程序一樣,唯一的不同是對Uno UI的引用。 魔術發生在共享項目中。

Similar to the Shared project in Xamarin.Forms, this is where you will write all your shared logic and UI. Uno provides support for the MVVM, a design pattern many developers are familiar and comfortable with.

與Xamarin.Forms中的Shared項目相似,在這里您將編寫所有共享的邏輯和UI。 Uno提供了對MVVM的支持, MVVM是許多開發人員熟悉并熟悉的設計模式。

那么,成品看起來像什么? (So, what does a finished product look like?)

Using the example "Todo" app provided by Uno here, here are examples from each of the four platforms.

使用Uno 這里提供的示例“ Todo”應用程序,這里是來自四個平臺的示例。

iOS

的iOS

Android

安卓系統

Web

網頁

UWP

超人

These projects all use logic and UI from the shared project. Code once, four apps.

這些項目都使用共享項目中的邏輯和UI。 編寫一次,四個應用程序。

讓我們談談調試。 (Let's talk debugging. )

Debugging in Uno can be a bit different depending which platform you are trying to debug.

Uno中的調試可能會有所不同,具體取決于您要調試的平臺。

Android and iOS - For mobile, you will use the same Mono debugger you are used to using in Visual Studio, with access to all your favorite breakpoints, value changes, etc.

Android和iOS-對于移動設備,您將使用與Visual Studio中相同的Mono調試器,并可以訪問所有喜歡的斷點,值更改等。

Web - Currently there is only support for chromium debugging, which means Chrome and Edge.

網絡 -目前僅支持Chrome調試,即Chrome和Edge。

UWP - Here, the tooling comes from .NET studios which is not as efficient with the mono runtime.

UWP-在這里,該工具來自.NET Studio,這在Mono運行時中效率不高。

Want to try out Uno but don't want to go through the steps to get set up through Visual Studio?

是否想嘗試Uno,但不想執行通過Visual Studio進行設置的步驟?

Then checkout their playground!

然后結帳他們的游樂場 !

The Uno Playground is a fun and easy way to look at how different items render on different platforms. They make it quick and easy to try out new styles and is great for beginners and tutorials.

Uno Playground是一種有趣而簡單的方法,可以查看不同項目在不同平臺上的呈現方式。 它們使您可以輕松快捷地嘗試新樣式,非常適合初學者和教程。

我們可以期待哪些未來功能? (What are future features we can look forward to?)

  1. Support for MacOS or Linux.

    支持MacOS或Linux。
  2. More features from UWP API

    UWP API的更多功能
  3. Support for smart watches

    支持智能手表

The true beauty of Uno is that it encompasses what we as developers should all be striving to accomplish - building on top of each others' accomplishments. We don't need to re-create the wheel, real innovation happens when you stand on the shoulders of giants and we all move upwards.

Uno的真正優點在于它涵蓋了我們所有人作為開發人員都應努力實現的目標-建立在彼此的成就之上。 我們不需要重新制造輪子,當您站在巨人的肩膀上并且我們都向上移動時,真正的創新就會發生。

Happy coding.

快樂的編碼。

For more lessons and tips for Uno, checkout my blog.

有關Uno的更多課程和提示,請查看我的博客 。

翻譯自: https://www.freecodecamp.org/news/uno-platform/

neo-6m uno

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/391104.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/391104.shtml
英文地址,請注明出處:http://en.pswp.cn/news/391104.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

【轉】消息隊列應用場景

一、消息隊列概述 消息隊列中間件是分布式系統中重要的組件,主要解決應用耦合,異步消息,流量削鋒等問題。實現高性能,高可用,可伸縮和最終一致性架構。是大型分布式系統不可缺少的中間件。 目前在生產環境,…

JDK和JRE區別是什么

問題:JDK和JRE區別是什么 他們的角色分別是什么?我們應該什么時候使用他們? 回答一 JRE是Java Runtime Environment(Java運行時環境)。它是一個包,集合了運行一個編譯好的Java程序的一切必須的東西&…

樹莓派新手入門教程

http://www.ruanyifeng.com/blog/2017/06/raspberry-pi-tutorial.html

lime 模型_使用LIME的糖尿病預測模型解釋— OneZeroBlog

lime 模型Article outline文章大綱 Introduction 介紹 Data Background 資料背景 Aim of the article 本文的目的 Exploratory analysis 探索性分析 Training a Random Forest Model 訓練隨機森林模型 Global Importance 全球重要性 Local Importance 當地重要性 介紹 (Introd…

react 生命掛鉤_如何在GraphQL API中使用React掛鉤來管理狀態

react 生命掛鉤In this blog post, we are going to learn -在這篇博客中,我們將學習- What React hooks are 什么是React鉤子 How to use hooks for state management 如何使用掛鉤進行狀態管理 Before we start working with hooks, let us take a brief moment …

Linux第三周作業

1.三個法寶 ①存儲程序計算機工作模型,計算機系統最最基礎性的邏輯結構; ②函數調用堆棧,堆棧完成了計算機的基本功能:函數的參數傳遞機制和局部變量存取 ; ③中斷,多道程序操作系統的基點,沒有…

什么時候使用靜態方法

問題:什么時候使用靜態方法 I am wondering when to use static methods? Say if I have a class with a few getters and setters, a method or two, and I want those methods only to be invokable on an instance object of the class. Does this mean I shou…

RESTful API淺談

2019獨角獸企業重金招聘Python工程師標準>>> 上半年時候,部門有組織的討論了一下實踐微服務的技術話題,主要內容是SOA服務和微服務各自的優勢和難點,其中有提到關于RESTful API設計方法。 正好最近在深入的學習HTTP協議&#xff0…

spring自動注入--------

<?xml version"1.0" encoding"UTF-8"?> <beans xmlns"http://www.springframework.org/schema/beans"xmlns:p"http://www.springframework.org/schema/p"xmlns:c"http://www.springframework.org/schema/c"xmlns…

變量的作用域和生存期:_生存分析簡介:

變量的作用域和生存期:In the previous article, I have described the Kaplan-Meier estimator. To give a quick recap, it is a non-parametric method to approximating the true survival function. This time, I will focus on another approach to visualizing a surviv…

數字孿生營銷_如何通過數字營銷增加您的自由職業收入

數字孿生營銷There are a lot of ways we could go with this topic as it’s a huge one, but I just want to cover the nuggets here and make it simple as well as practical to understand and implement.我們可以采用很多方法來處理這個主題&#xff0c;因為它是一個很大…

您的網卡配置暫不支持1000M寬帶說明

國內寬帶網速越來越快&#xff0c;運營商更是在今年初紛紛推進千兆寬帶業務。為了讓用戶更好地了解網絡狀況&#xff0c;360寬帶測速器發布新版&#xff0c;優化了寬帶測速范圍&#xff0c;可有效支持最高1000&#xff2d;的帶寬測量。此外&#xff0c;寬帶測速器能檢測用戶網卡…

教輔的組成(網絡流果題 洛谷P1231)

題目描述 蒟蒻HansBug在一本語文書里面發現了一本答案&#xff0c;然而他卻明明記得這書應該還包含一份練習題。然而出現在他眼前的書多得數不勝數&#xff0c;其中有書&#xff0c;有答案&#xff0c;有練習冊。已知一個完整的書冊均應該包含且僅包含一本書、一本練習冊和一份…

Java中怎么樣檢查一個字符串是不是數字呢

問題&#xff1a;Java中怎么樣檢查一個字符串是不是數字呢 在解析之前&#xff0c;怎么樣檢查一個字符串是不是數字呢 回答一 這些通常是由一個簡單的用戶自定義函數去解決的&#xff08;即&#xff0c;自帶的 “isNumeric” 函數&#xff09; 例如 public static boolean…

小程序支付api密鑰_如何避免在公共前端應用程序中公開您的API密鑰

小程序支付api密鑰問題 (The Problem) All you want to do is fetch some JSON from an API endpoint for the weather, some book reviews, or something similarly simple.您要做的就是從API端點獲取一些有關天氣的JSON&#xff0c;一些書評或類似的簡單內容。 The fetch qu…

永無止境_永無止境地死:

永無止境Wir befinden uns mitten in der COVID-19-Pandemie und damit auch im Mittelpunkt einer medialen Geschichte, die durch eine noch nie dagewesene Komplexitt und Dynamik gekennzeichnet ist. Wie kann Informationsdesign helfen, diese Explosion von Nachrich…

HDU4612 Warm up —— 邊雙聯通分量 + 重邊 + 縮點 + 樹上最長路

題目鏈接&#xff1a;http://acm.split.hdu.edu.cn/showproblem.php?pid4612 Warm up Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 7206 Accepted Submission(s): 1681 Problem DescriptionN planets are …

Android sqlite load_extension漏洞解析

路人甲 2015/09/25 14:540x01 sqlite load_extensionSQLite從3.3.6版本&#xff08;http://www.sqlite.org/cgi/src/artifact/71405a8f9fedc0c2&#xff09;開始提供了支持擴展的能力&#xff0c;通過sqlite_load_extension API&#xff08;或者load_extensionSQL語句&#xf…

去除Java字符串中的空格

問題&#xff1a;去除Java字符串中的空格 俺有一個像這樣的字符串 mysz "namejohn age13 year2001";我想要去除字符串里面的空格。我嘗試使用 trim() &#xff0c;但是呢它只去除了字符串前后的空格。我也嘗試用 ("\W", “”)&#xff0c;但是它把也給搞…

谷歌瀏覽器bug調試快捷鍵_Bug壓榨初學者指南:如何使用調試器和其他工具查找和修復Bug

谷歌瀏覽器bug調試快捷鍵As web developers, it often feels like we spend more time fixing bugs and trying to solve problems than we do writing code. In this guide well look at some common debugging techniques, so lets get stuck in.作為Web開發人員&#xff0c;…