Native development Application development

Microsoft’s camp

Winform

WinForm is a title for Windows Form in the.net development platform.

If you want to go deeper and beautify the UI, it takes a lot of effort, and it takes a lot more time to beautify the Winform interface and custom controls than the current mainstream CSS stylesheets.

WPF

The XML+C#+CSS rendering allows for more flexible design width on the UI

WPF and WinForms are two very different UI technologies, and WPF is not a complete replacement for WinForms.

WPF doesn’t run on other operating systems, and writing stylesheets in XAML is still not as universal as HTML, which is better in terms of learning and application.

UWP

If your APP only needs to run on Windows, I think WPF or UWP is the best choice. After all, Microsoft’s own sons have a huge advantage in calling system native apis.

Ides and other programs developed by a wide variety of technologies on Windows

  • Performance: worst in Java -> Electron -> WindowsForms -> native -> WPF

  • Java -> Electron -> WPF -> WindowsForms -> native

Java camp

Swing

Almost all the old folks who learned Java in the 2000s began to learn it from Swing. Swing’s enigmatically default UI aesthetic made me give up the motivation to continue learning.

JavaFx

The advantage is that it can be cross-platform, but the downside is that the ecosystem is very bad and, like Winforms, it’s relatively difficult to customize some controls.

Adobe camp

Air

Flex applications, which have the advantage of being cross-platform and making a lot of cool animations based on Flash, have the disadvantage of being extremely inefficient and cumbersome to call native apis of the operating system. As Flash has lost ground in browsers, the Air has slipped out of sight.

Apple

Objective-c (or Swift now), like Winforms, is a very convenient way to call the underlying APIS of the operating system. It has the same disadvantages: it is not cross-platform, custom controls are complex, and there are few resources available. Now most programmers are based on C#, Java development, if not Apple loyalists, roots will not spend a lot of effort on research

Cross-platform software application development

Direct element development is certainly the best — the performance is guaranteed, but the main advantage of cross-platform is the reuse of code logic, reducing the cost of developing the same logic on different platforms. It is ideal and safest for an enterprise to have a set of business logic that can be used in multiple places.

Electron

Electron is an open source library developed by Github for building cross-platform desktop applications using HTML, CSS and JavaScript. Electron does this by merging Chromium and Node.js into the same runtime environment and packaging them as applications for Mac, Windows and Linux. With Node it provides capabilities that are typically not available in browsers.

The electron is characterized by its ability to reuse various wheels at the front end. So it’s fast to develop and easy to hire.

The system API can be easily called through Node.js, the local dictionary entries can be cached using SQLite, the complex computation logic can be carried out on the client side to relieve the pressure on the server side, etc.

Electron has thousands of mature projects on the desktop, which flutter, Javafx, Swiftui, is still not comparable

The difference between electron and Nod-webkit (now nW-js) :

. Conceptually, Electron is similar to NW.js, but there are important differences: One major difference is that Electron uses the functions of Chromium through the Googles Chromium Content Module, while nwG.js directly uses the Chromium itself.

Electron is built on Chromium and NodeJS, one for the interface and one for the logic behind it



Cordova, PhoneGap

Cordova[ˈkɔːdəbə] is a rapid development platform for creating mobile cross-platform mobile applications based on HTML, CSS and JavaScript

On October 4, 2011, Adobe acquired PhoneGap and Nitobi Software, the startup company behind PhoneGap Build. The core PhoneGap code was spun off and donated to Apache, which renamed it Cordova.

Core things are H5 Native interaction principle, Bridge, defined parsing rules (Engine)


Cordova Application is an encapsulation layer of Cordova framework that is independent of different mobile phone operating systems. Specific include

  • The Web App layer is the main place for developers to write code. The application is presented in the form of a Web page, referencing various Web resources needed, such as CSS, JavaScript, images, audio files, and so on, in a local page file of index.html. The configuration for the application is saved in a config.xml file.

    For a Web app initialized using cordova CLI, there is a config. XML file in the home directory, which contains the basic information about the app, such as appName, app entry file, whitelist, webView initialization configuration, Plugin information, and icon resource information

  • The WebView layer is used to present the user interface, the presentation of the Web page. For example, on the Android platform, web pages are rendered through the WebView control.

  • Plugins are used to invoke native functionality of each platform in JavaScript code. The Cordova project already includes some core plugins, such as battery, camera, address book, etc. Developers can also develop custom plugins to implement the desired functionality.

Mobile OS is the specific Mobile operating system layer

Cordova prepackages the most common native API calls on mobile OS and provides webApp developers with the same JavaScript API.

For webApp developers, there is no need to pay attention to the details of the implementation of the system’s underlying call, and the so-called “cross-platform” is achieved. In fact, each platform involves the invocation of native capabilities, which are encapsulated in the form of plug-ins. (The implementation of each plug-in is actually still Native).

JS and Native is how to achieve intermodulation, here first study android

Cordova-android uses addJavascriptInterface (API of Android Webview) and JS Prompt to implement JS invocation of Native API.

Let’s first look at one of the key classes in the Cordova-Android framework: CordovaActivity.java.

This class inherits the Android Activty class and is actually the Cordova-Android Launcher Activity.

After the application starts, the core does two things: read config.xml and loadUrl. This loadUrl is actually the launch page that loads the WebApp (default is index.html).

For IOS, see How Cordova Works (IOS). Here is a brief introduction to how Cordova works.

Xamarin

Xamarin is an open source platform for building new high performance applications for iOS, Android and Windows via.NET.

Xamarin mainly includes Xamarin.Android, Xamarin. IOS, Xamarin.Forms, and Xamarin. Essentially, it’s a layer of C# encapsulation of the native API, so it’s very similar to the native API. This encapsulation combines some of the syntactic features of C#, allowing developers to enjoy the syntactic sugar of C#. Xamarin. IOS is compiled directly into the ARM binary code, so the execution efficiency must be very high.

Xamarin.Android is compiled into an intermediate language, and Xamarin will include a mono (cross-platform) in the APK installation package. NET runtime environment), the code does its work on both the Mono runtime and the Android native runtime.

The Mono [ˈm – (U -) – (U -) – (U -) – (U -) – (u -) – (u -) -) virtual machine contains a real-time compilation engine which is available for the following processors: x86, SPARC, PowerPC, ARM, S390 (32-bit mode and 64-bit mode), x86-64, IA64, and SPARC in 64-bit mode. The virtual machine can compile code in real time or pre-compile to native code. For systems not listed, a code interpreter is used.

Xamarin is an abstraction layer that manages the communication between shared code and the underlying platform code. Xamarin runs in a managed environment that provides amenities such as memory allocation and garbage collection.

Founded in 2011, Xamarin aims to make mobile development incredibly fast and easy.

Xamarin is for developers with the following goals:

  • Sharing code, tests, and business logic across platforms.

  • Write a cross-platform application in C# using Visual Studio.

Xamarin allows you to create native uis on each platform and write cross-platform shared business logic in C#. In most cases, 80% of the application code can be shared using Xamarin.

Xamarin’s key technology, Xamarin.Forms, abstracts the GUIs of IOS, Android, UWP and other platforms. Developers only need to write a set of code, and the compiler will map the interface to the original controls at compile time, thus getting the look and performance of the native platform.

Built on top of.NET, Xamarin automatically handles tasks such as memory allocation, garbage collection, and interoperability with the underlying platform.

Xamarin used to be available for a fee, which is said to be expensive, so the number of users was relatively small and it was almost unheard of in China. Xamarin was later acquired by Microsoft and is now free to use, but since learning nothing about.NET, I have not been interested in Microsoft stuff. Microsoft’s products are good, but they do not sell well.

Flutter

The Flutter is a Google open source CROSS-platform UI development framework for Android and iOS. It is currently available on the Web and MacOS, and will continue to be available on Windows and Linux.

Dart UI is a C++ implementation of the Dart: UI library Native Binding, and the UI Lib is the main entry point for the Dart GUI program.

The Dart UI provides the upper layer with generic drawing capabilities for window, text, Canvas, and Geometry. When Runtime calls the Dart UI, the Dart UI executes and renders images to the Window based on the passed main entrypoint.

React-native, WEEX, and Flutter are all UI frameworks that address cross-platform UI implementations, allowing interface layout or implemented business logic to be unified across multiple interfaces. However, it is only a UI framework. React-native itself relies on native controls, and the WebView and MapView of Flutter depend on native development.

Dart was originally developed by a bunch of Java programmers to make it easier to write UIs. If you have more Java/Swift programmers on your team, the Flutter is faster in terms of getting started.

Why Dart

  • Dart has better performance. Dart, in JIT mode, is about as fast as JavaScript. However, Dart supports AOT, and when running in AOT mode, JavaScript is far from catching up.

  • Native Binding. On Android, V8’s Native Binding works fine, but JavaScriptCore on iOS does not, so the code pattern for the underlying Framework of Flutter is difficult to unify if you use JavaScript. Dart’s Native Binding can be implemented well using the Dart Lib.

  • Fuchsia OS’s built-in App browser uses Dart as the App’s development language. And actually, the Flutter isa conceptual subset of Fuchisa OS’s application framework.

  • Dart is a type-safe language with sophisticated package management and many features. Google brought together design experts from so many programming languages to develop a language designed to replace JavaScript, so Fuchsia OS has Dart built into it. Dart’s ability to be embedded as an application in the Embedded Lib, rather than being updated with updates, is also an advantage.

What is a Skia?

Skia is a 2D drawing engine library, formerly a vector drawing software, Chrome and Android use Skia as a drawing engine. Skia provides a very friendly API and provides friendly and efficient performance in graphic conversion, text rendering, bitmap rendering. Skia is cross-platform, so can be embedded into the Flutter iOS SDK without having to study the iOS closed source Core Graphics/Core Animation. Because Android comes with Skia, the Flutter Android SDK is much smaller than the iOS SDK.

QT C++

QT’s biggest advantage is that it’s cross-platform! High efficiency! However, like Objective-C, CPP is a mountain in front of many Server Side programmers, and without the mountain of CPP in front of it, I think QT is the best Desktop Application and especially embedded terminal UI development framework.

Another advantage of QT is that it seems to be a little bit easier on the UI than it was before, and it can even use JavaScript directly in ITS QML (Java also has a built-in JS engine, of course). QT also includes a large number of standard CSS stylesheets to work with

If you want to engage in Desktop Application development in a true sense, QT is definitely worth learning.

QT has a visual editor, but it’s probably a little better than NetBeans’ Swing, but it’s nowhere near as good as VS, but most of the actual development is code based

x-platform

I don’t think there’s much to look forward to.



Reference article:

Quickly understand Electron: a new generation of web-based cross-platform desktop technology www.cnblogs.com/imstudy/p/1…

Flutter zhuanlan.zhihu.com/p/36861174 Jane solution principle



Reprint the home station article the GUI client software development techniques to ramble: native and cross-platform solutions analysis “, please indicate the source: www.zhoulujun.cn/html/webfro…