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.mzph.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;…