基于.NET的跨平台应用程序框架介绍

随着.NET 8的发布,我也将我的书.NET MAUI Cross-Platform Application Development更新到了第二版,已经在3月25日开始正式发行。第一版是基于.NET 6编写的,第二版更新到了 .NET 8。这是一本介绍.NET MAUI的书籍。可以通过下面的链接购买。

https://epa.ms/maui

figure00

在第二版的评审过程中,通过与同行的交流,我总觉得并不应该只用.NET MAUI来代表基于.NET的跨平台解决方案。

.NET MAUI是一种跨平台应用框架,在这里我强调的是应用框架。它与其它的主流跨平台应用框架如Flutter,React Native或者Ionic等一样,都属于应用框架。应用框架通常是建立在通用框架和相应的编程语言之上的。我们有很多通用框架和语言可选择,如Java/JVM,JavaScript/Node.js以及C#/.NET Core等。跨平台应用开发的挑战主要来自于对用户界面的处理,所以根据不同的用户界面处理方案,我们大致可以将跨平台应用框架分为以下三类。

  • 原生用户界面抽象化:通过抽象化用户界面元素,将其映射到系统的原生控件。目前.NET MAUI和React Native使用这种方案。这种方案的好处是,应用的用户界面与原生是一致的。原生控件的更新变化,会自动在应用中生效。缺点是比较难将控件精确的映射到每个所支持的平台。
  • 使用2D图形库:使用2D图形库来绘制用户界面控件。Flutter和Avalonia UI使用的是这种方案。好处是摆脱了对原生控件的依赖。对所有支持的平台,应用界面高度一致。缺点是与原生控件的行为可能不一致,特别是原生控件更新了以后,跨平台应用的行为会与原生控件有差异。
  • 使用WebView:这一方案是通过使用浏览器的界面来构建用户界面。Ionic和.NET MAUI Blazor都使用这种方案。这种方案可以重用前端应用的代码,因为都是以HMTL/CSS/JavaScript来构建的。但这个方案会受到基于浏览器的局限,用户界面更类似网页应用而非原生应用。

从上面的分类可以看出,基于.NET的应用框架,涵盖了所有可能的实现方式,而非只是基于.NET MAUI的跨平台方案。本文将对基于.NET的应用框架做一个介绍和初步的比较。

基于.NET的跨平台应用框架主要有下面几种:

  • .NET MAUI
  • .NET MAUI Blazor Hybrid
  • Avalonia UI
  • Uno Platform
  • Xamarin (.NET for Android, .NET for iOS and .NET for Mac)

这些应用框架都是建立在.NET之上的,或者说是建立在.NET 6之后的.NET之上的。因为原始的.NET Framework本身并不是一个跨平台框架。通过与开源项目Mono的整合,才逐渐演变成了今天的类似Java/JVM的跨平台通用框架。开源项目Mono提供了对Android, iOS, macOS和Linux等的.NET支持。Mono项目的另一重要贡献就是开发了Xamarin这一层中间件。我之所以使用中间件而非框架来描述Xamarin,是因为它本身并不是一个全新的东西,它只是为其下的平台提供.NET接口。通过使用Xamarin,.NET应用可以直接使用C#访问几乎所有平台提供的功能。如,Xamarin.Android提供了所有原生的Android API。同样的Xamarin.iOS也提供了所有iOS的API。

在Xamarin的基础上,开源团队推出了Xamarin.Forms这一跨平台用户界面解决方案。Xamarin提供了使用.NET/C#进行原生开发的能力。非用户界面代码封装成.NET Standard库来实现代码复用。
如下图所示的Xamarin.Forms架构图。

figure01

Figure 1: Xamarin.Forms 架构

在上图中,我用上标标出了相应开源代码的链接。你可以参考本文底部的参考链接。基于Xamarin的方案有多种实施方式。

Xamarin.Forms和.NET MAUI的跨平台方案都是通过抽象原生控件来实现的。抽象化的控件通过Xamarin.Forms renderer或者.NET MAUI handlers映射到原生控件上,如下图所示。

figure02

Figure 2: Xamarin.Forms Renderers and .NET MAUI Handlers

在上图中,可以看到抽象控件Button在Xamarin.Forms和.NET MAUI中的实现。在Xamarin.Forms中,跨平台控件Button,通过ButtonRenderer映射到不同平台的原生控件,如在iOS上的UIButton,Android上的AppCompatButton和Windows上的 Button。
在.NET MAUI中,跨平台控件Button,通过IButton接口和ButtonHandler映射到不同平台的原生控件。

如果想最大限度地复用代码,你可以使用Xamarin.Forms和.NET Standard库,这样代码的复用率可以达到90%以上。

如果你对性能和用户体验有较高的要求,可以直接基于Xamarin构建应用,这种开发非常类似于原生开发。所有的平台都使用.NET和C#,在一定程度上也可以复用代码。

figure03

Figure 3: Native Application Development using Xamarin

微软在.NET 6之后发布了.NET MAUI。可以说,.NET MAUI比起Xamarin.Forms更像是一种演进,而不是革命性的变化。如下图所示,.NET MAUI取代了Xamarin.Forms。而.NET for Android,.NET for iOS和.NET for Mac也无疑都是Xamarin.Android,Xamarin.iOS和Xamarin.Mac的更新。为了方便起见,在本文中,我仍然将使用Xamarin表示此层。几个基于Xamarin项目的GitHub仓库仍然是一样的。.NET本身自.NET 5以来,也出现了很大的变化,也就是在所有平台上都有了统一的.NET BCL。

figure04

Figure 4: .NET MAUI 架构

在发布.NET MAUI之后,我们仍然可以使用Xamarin进行原生开发,并不一定非得使用.NET MAUI。例如,我们可以单独使用.NET for Android来使用.NET/C#来开发原生Android应用。

.NET MAUI还有一种使用方式,即使用Blazor开发.NET MAUI Blazor Hybrid应用。Blazor是一种基于.NET的网络应用开发方案。在.NET MAUI中,增加了一个特殊的控件BlazorWebView。这是一个支持Blazor的WebView控件。我们可以使用BlazorWebView来开发用户界面,这样我们就可以使用同一套代码来开发网络、移动以及桌面应用。

使用.NET MAUI开发跨平台应用,目前并不支持Linux。虽然有开源项目在开发Linux的支持,但进展并不顺利。.NET MAUI借助将抽象控件映射到原生控件的方案,在Linux上比较困难。Linux与Android,iOS,macOS,Windows等不同,没有统一的用户界面库,而是具有多个用户界面库如GTK或QT等。

在基于.NET的方案中,Avalonia UI和Uno Platform都支持Linux。下面我们将分别介绍这两者。

Avalonia UI使用2D图形库自行实现控件。如下图所示,除了2D图形库Skia,Avalonia UI只依赖于.NET。在.NET之上,Avalonia UI使用Skia库实现了自己的所有控件。因此,Avalonia UI在所有平台上的表现非常一致。

figure05

Figure 5: Avalonia UI 架构

Avalonia UI这个开源项目起源于将WPF框架扩展到macOS和Linux的想法,它起初是一个桌面应用框架。而在.NET 6之后,该项目也把移动应用和WebAssembly加入了框架之中。基于Avalonia UI的应用编程与WPF应用的开发过程高度类似。对于熟悉WPF应用开发的开发者来说,这是非常容易上手的。

除了.NET MAUI和Avalonia UI外,我们还要比较的另一个跨平台框架是Uno Platform。.NET MAUI和Avalonia UI都非常具有代表性,分别代表了使用原生控件和使用2D图形库的跨平台实现。而Uno Platform则是一个兼具两种特性的解决方案,如下图所示。

figure06

Figure 6: Uno Platform 架构

Uno Platform针对不同的系统采用了不同的解决方案。

  • Android、iOS和macOS:Uno Platform使用了Xamarin来实现在Android,iOS和macOS上的控件。这点与.NET MAUI类似,但由于Uno Platform也是从WPF演变来的,因此Uno应用的编写方式也与WPF类似。在最新的版本中,直接使用了WinUI 3。
  • Windows:如果是Windows应用,在Uno Platform上,与WinUI 3的应用没有任何区别。
  • Linux:对Linux的支持方面,Uno Platform使用了与Avalonia UI相同的方式,即通过Skia自行实现控件。
  • WebAssembly:对WebAssembly的支持则是将C#/XAML转换成HTML/CSS。

从这里我们可以看出,Uno Platform采用的是一种混合的实现方式。

下面的表格对这几种跨平台方案进行了总结和比较。

table01

当我们将所有框架组合在一起时,我们可以看到下面的图7。尽管看上去有点复杂,但这个图清楚地展示了.NET MAUI、Uno平台和Avalonia UI如何融入.NET架构。

figure07

Figure 7: .NET cross-platform solutions

通过本文的介绍,我们可以看到,基于.NET的跨平台方案有多种实现方式,每种实现方式都有其优缺点。选择哪种方案需要根据实际的使用场景来决定。

References:

  1. .NET MAUI source code
    https://github.com/dotnet/maui
  2. .NET for Android source code – Both .NET for Android and Xamarin.Android are built from this repository with different build configurations.
    https://github.com/xamarin/xamarin-android
  3. .NET for iOS source code – Both .NET for iOS and Xamarin.iOS are built from this repository with different build configurations.
    https://github.com/xamarin/xamarin-macios
  4. .NET for Mac source code - .NET for iOS and .NET for Mac are shared the same code base with different build configuration.
    https://github.com/xamarin/xamarin-macios
  5. WinUI
    https://github.com/microsoft/microsoft-ui-xaml
  6. Avalonia UI
    https://github.com/AvaloniaUI/Avalonia
  7. Skia
    https://github.com/google/skia
  8. Uno Platform
    https://github.com/unoplatform/uno
  9. Avalonia UI and MAUI - Something for everyone
    https://www.avaloniaui.net/Blog/avalonia-ui-and-maui-something-for-everyone
  10. Xamarin.Forms
    https://github.com/xamarin/Xamarin.Forms
  11. Mono
    https://github.com/mono/mono
  12. .NET MAUI Cross-Platform Application Development
    https://www.packtpub.com/product/net-maui-cross-platform-application-development-second-edition/9781835080597

摘要

该文章对.NET跨平台应用程序框架进行了深入的评述。它介绍了.NET跨平台应用程序框架,并将其与其他应用程序框架(如Flutter、React Native或Ionic)进行了比较。文章还介绍了基于.NET的各种可用的跨平台应用程序框架,包括.NET MAUI、.NET MAUI Blazor混合、Avalonia UI、Uno平台和Xamarin。 此外,它解释了这些框架的使用和好处以及它们的比较,包括它们的架构。它得出的结论是,框架的选择在很大程度上取决于实际使用场景,因为所有框架都有其独特的优点和缺点。

Introduction of .NET cross-platform application frameworks

With the launch of .NET 8, I also updated my book .NET MAUI Cross-Platform Application Development to the second edition, which will be released in the first quarter of this year. The first edition was written based on .NET 6, and the second edition was updated to .NET 8. This is a book introducing .NET MAUI and you can find the book at https://epa.ms/maui.

figure00

During the review process of the second edition, through exchanges with peers, I always felt that .NET MAUI should not be the only representative of cross-platform solutions based on .NET.

.NET MAUI is a cross-platform application framework, and here I emphasize “application framework”. It is the same as other mainstream cross-platform application frameworks like Flutter, React Native or Ionic etc., which all belong to application frameworks. Application frameworks are usually built on general frameworks and corresponding programming languages. We have many choices of general frameworks and languages, such as Java/JVM, JavaScript/Node.js, and C#/.NET Core, etc. The challenge of cross-platform application development mainly comes from the processing of the user interface, so according to different user interface solutions, we can roughly divide cross-platform application frameworks into the following three categories.

  • Native UI Abstraction: This kind of framework abstracts user interface elements and maps them to native controls on the system. Currently, .NET MAUI and React Native use this scheme. The advantage of this method is that the application interface is consistent with the native ones. As native controls update or change, they will automatically take effect in the application. The drawback is that it is challenging to accurately map controls to each supported platform.
  • Using 2D Graphics Library: This method uses a 2D graphics library to draw user interface controls. Flutter and Avalonia UI employ this method. It is not dependent on native controls and so, the application interface is incredibly consistent across all supported platforms. A potential limitation might be inconsistency with native control behavior, especially if native controls have been updated recently, causing discrepancies between cross-platform application behavior and native controls.
  • Using WebView: This method involves using a browser interface to build the application user interface. Both Ionic and .NET MAUI Blazor use this scheme. It allows the reusing of front-end application code, having been constructed via HTML/CSS/JavaScript. However, it is limited to a browser-based application, making it more like a web app than a native app.

From the above classification, it can be seen that the application framework based on .NET covers all possible implementation methods, not just the cross-platform solution based on .NET MAUI. This article will introduce and compare the application frameworks based on .NET preliminarily.

The main cross-platform application frameworks based on .NET include:

  • .NET MAUI
  • .NET MAUI Blazor Hybrid
  • Avalonia UI
  • Uno Platform
  • Xamarin (.NET for Android, .NET for iOS, and .NET for Mac)

All these frameworks are built on .NET, or it could be said that they are built on .NET 6 and beyond. The original .NET Framework is not a cross-platform framework. It gradually evolved into a general cross-platform framework similar to Java/JVM as a result of integrating with the open-source project Mono. The Mono project provided .NET support for Android, iOS, macOS, Linux, etc. Another significant contribution of the Mono project was the development of the Xamarin middleware. The reason I use middleware to describe Xamarin instead of a framework is because it is not something entirely new; it merely provides .NET interface for the platforms beneath it. By using Xamarin, .NET applications can directly access almost all features provided by the platform using C#. For example, Xamarin.Android offers all native Android APIs. Similarly, Xamarin.iOS provides all iOS APIs.

Based on Xamarin, the open-source team launched Xamarin.Forms, a cross-platform user interface solution. Xamarin provides the ability to develop natively with .NET/C#. Non-user interface code is encapsulated in a .NET Standard library to enable code reuse. The architecture diagram of Xamarin.Forms as shown below.

figure01

Figure 1: Xamarin.Forms architecture

In the above diagram, I have marked the corresponding open-source code links in superscript, which you can find in the reference links at the end of the article.

The cross-platform solution Xamarin.Forms or .NET MAUI is realized by abstracting native controls. Xamarin.Forms maps abstract controls to native controls using renderers and .NET MAUI uses handlers, as we can see in the following diagram.

figure02

Figure 2: Xamarin.Forms Renderers and .NET MAUI Handlers

In the above figure, you can see the implementation of the abstract widget Button in Xamarin.Forms and .NET MAUI. In Xamarin.Forms, the cross-platform widget Button is mapped to native widgets on different platforms through ButtonRenderer, such as UIButton on iOS, AppCompatButton on Android, and Button on Windows.
In .NET MAUI, the cross-platform widget Button is mapped to native widgets on different platforms through the IButton interface and ButtonHandler.

There are multiple ways to implement the Xamarin-based scheme. If you want to reuse code to the greatest extent
possible, you can use Xamarin.Forms and .NET Standard library, which can achieve a code reuse rate of over 90%.

If you have higher requirements for performance and user experience, you can build applications directly based on Xamarin, which is very similar to native development. As shown in the following diagram, native apps can be built on top of Xamarin and all platforms use .NET and C#, which allows code reuse to a certain extent.

figure03

Figure 3: Native Application Development using Xamarin

Microsoft released .NET MAUI after .NET 6. It could be said that .NET MAUI is more of an evolution from Xamarin.Forms than a revolutionary change. As shown in the diagram below, .NET MAUI has replaced Xamarin.Forms. .NET for Android, .NET for iOS, and .NET for Mac are undoubtedly updates to Xamarin.Android, Xamarin.iOS, and Xamarin.Mac. For simplicity, I will still use Xamarin to represent this layer in this article. The GitHub repositories for these projects based on Xamarin still remain the same. There have been significant changes in .NET itself since .NET 5, namely the unified .NET BCL across all platforms.

figure04

Figure 4: .NET MAUI architecture

After releasing .NET MAUI, we can still use Xamarin for native development and don’t necessarily have to use .NET MAUI. For example, we can use .NET for Android individually to develop native Android applications using .NET/C#.

Another way to use .NET MAUI is to develop .NET MAUI Blazor Hybrid applications using Blazor. Blazor is a .NET-based web application development solution. In .NET MAUI, a special control called BlazorWebView has been added. This WebView control supports Blazor. We can use BlazorWebView to develop the user interface, allowing us to use the same set of codes to develop web, mobile, and desktop applications.

When developing cross-platform applications using .NET MAUI, Linux is currently not supported. Although an open-source project is working on Linux support, the progress is not going well. .NET MAUI’s scheme of mapping abstract controls to native controls is challenging on Linux. Unlike Android, iOS, macOS, and Windows, Linux does not have a unified user interface library but has multiple user interface libraries such as GTK or QT.

Among the solutions based on .NET, both Avalonia UI and Uno Platform support Linux. Next, we will introduce these two respectively.

Avalonia UI uses a 2D graphics library to implement controls independently. As shown in the diagram below, apart from the 2D graphics library Skia, Avalonia UI depends only on .NET. Built on .NET, Avalonia UI uses the Skia library to implement all its controls. Therefore, Avalonia UI performs very consistently on all platforms.

figure05

Figure 5: Avalonia UI architecture

The Avalonia UI open-source project originated from the idea of extending the WPF framework to macOS and Linux. It started as a desktop application framework. After .NET 6, the project also added mobile applications and WebAssembly into the framework. The application development based on Avalonia UI is highly similar to the development process of WPF applications. For developers familiar with WPF application development, this is very easy to get started with.

In addition to .NET MAUI and Avalonia UI, another cross-platform framework we need to compare is the Uno Platform. Both .NET MAUI and Avalonia UI are very representative, representing cross-platform implementations using native controls and the 2D graphics library respectively. The Uno Platform is a solution that combines both features, as shown in the figure below.

figure06

Figure 6: Uno Platform architecture

Uno Platform uses different solutions for different systems.

  • Android, iOS, and macOS: Uno Platform uses Xamarin to implement controls on Android, iOS, and macOS. This is similar to .NET MAUI, but since Uno Platform also evolved from WPF, Uno application writing is similar to WPF. In the latest version, WinUI 3 is used directly.
  • Windows: If it’s a Windows application, there is no difference between apps on the Uno Platform and WinUI 3.
  • Linux: Regarding Linux support, Uno Platform adopts the same method as Avalonia UI, implementing controls independently through Skia.
  • WebAssembly: Support for WebAssembly involves converting C#/XAML into HTML/CSS.

We can see that Uno Platform adopts a mixed implementation method.

The following table summarizes and compares these cross-platform solutions.

table01

When we assemble all the components, we can observe Figure 7 below. Despite its apparent complexity, it is a comprehensive illustration of all .NET cross-platform solutions in one place. This diagram clearly demonstrates how .NET MAUI, Uno Platform, and Avalonia UI integrate into the .NET architecture.

figure07

Figure 7: .NET cross-platform solutions

Through the introduction in this article, we can see that there are various implementation methods for cross-platform solutions based on .NET, each with its own advantages and disadvantages. The choice of which scheme to use depends on the actual usage scenario.

References:

  1. .NET MAUI source code
    https://github.com/dotnet/maui
  2. .NET for Android source code – Both .NET for Android and Xamarin.Android are built from this repository with different build configurations.
    https://github.com/xamarin/xamarin-android
  3. .NET for iOS source code – Both .NET for iOS and Xamarin.iOS are built from this repository with different build configurations.
    https://github.com/xamarin/xamarin-macios
  4. .NET for Mac source code - .NET for iOS and .NET for Mac are shared the same code base with different build configuration.
    https://github.com/xamarin/xamarin-macios
  5. WinUI
    https://github.com/microsoft/microsoft-ui-xaml
  6. Avalonia UI
    https://github.com/AvaloniaUI/Avalonia
  7. Skia
    https://github.com/google/skia
  8. Uno Platform
    https://github.com/unoplatform/uno
  9. Avalonia UI and MAUI - Something for everyone
    https://www.avaloniaui.net/Blog/avalonia-ui-and-maui-something-for-everyone
  10. Xamarin.Forms
    https://github.com/xamarin/Xamarin.Forms
  11. Mono
    https://github.com/mono/mono
  12. .NET MAUI Cross-Platform Application Development
    https://www.packtpub.com/product/net-maui-cross-platform-application-development-second-edition/9781835080597

Summary

The article provides an in-depth review of .NET Cross-platform Application Frameworks. It introduces .NET cross-platform application frameworks and explains the comparison to other application frameworks such as Flutter, React Native or Ionic. The article also introduces the different cross-platform application frameworks available based on .NET including .NET MAUI, .NET MAUI Blazor Hybrid, Avalonia UI, Uno Platform & Xamarin. Further, it explains the use and benefits of these frameworks and their comparison, including their architecture. It concludes that the choice of the framework greatly depends on the actual usage scenario, as all the frameworks have their unique advantages and disadvantages.

To work with .NET MAUI user interface, I wish there was a template for Shell which I can start with it. However, the default template has only a very simple Shell example as below.

1
2
3
4
<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

I like the built-in Shell template in Xamarin.Forms so I rebuilt the same for .NET MAUI. If you like the same, you can use this project template.
This template includes the following features:

  1. A master-detail user interface using Shell
  2. Using MVVM Toolkit source generator to replace the original INotifyPropertyChanged
  3. Using .NET MAUI built-in Dependency Injection to replace DependencyService
  4. Added unit test using xUnit and NSubstitute

LoginPage

loginpage

AboutPage

aboutpage

Flyout menu

flyoutpage

ItemsPage

itemspage

NewItemPage

newitempage

You can download Visual Studio project template (.NET MAUI) at:

.NET MAUI Project and Item Templates - VS Marketplace

Build environment

This template is built using Visual Studio Version 17.5.0 on Windows.

Build and Test on macOS

I tested this template on macOS using Visual Studio for Mac Version 17.4.1. I cannot build and test using Visual Studio for Mac directly. We need to wait for a better .NET MAUI support in the future release.

However, it is possible to build and run from the command line.

Build and run as a Mac Catalyst app

1
dotnet build -t:Run -f net7.0-maccatalyst

Build and run on iOS

1
dotnet build -t:Run -f net7.0-ios

Known Issues

There are two issues on iOS and macOS as below.

newitempage

隐私声明

隐私保护声明适用范围包括PassXYZ应用及相关的网站。

本隐私声明阐述了 PassXYZ 处理的个人数据的方式和目的。

信息的收集,使用和分享

本网站是一个静态网站使用GitHub提供的服务。静态网站没有任何信息收集的能力。关于GitHub服务的使用,请参考GitHub的隐私保护声明。

PassXYZ应用帮助存储您的个人数据在本地设备并使用KeePass 加密格式。应用本身并不会通过网络收集任何个人数据。PassXYZ的部分字体和图标是从网络下载的。

隐私声明的更新

您可以通过本网站获取最新的隐私保护声明。

KPCLibPy is a KeePass command application written in Python.

The original KeePass by Dominik Reichl is a .NET application written in C#. KeePassLib is part of KeePass which can be built as a library to support the major functions of KeePass. However, at the moment, KeePassLib is still built for .NET framework which can run on Windows only. I modified KeePassLib and extended it as a .NET Standard library - KPCLib. KPCLib stands for KeePass Portable Class Library at the time when I started the work. Portable Class Library (PCL) is replaced by .NET Standard Library nowadays.

KPCLibPy is just a Python wrapper of KPCLib using Python.NET. In this perspective, KPCLibPy is fully compatible to the original KeePass, since the majority of code is the same as KeePass.

In order to save the development effort and have a nice user interface, the Python library python-nubia from Facebook is used as the framework to support command line interface.

Key Features

  • Full compatible with the original KeePass
  • .NET Standard 2.0 support with KPCLib
  • Cross platform support with .NET Standard and .NET core
  • Nice user interface with python-nubia
  • Interactive mode that offers fish-style auto-completion

Installation

As a developer, you can use KPCLibPy from GitHub directly.

1
2
3
4
5
$ git clone https://github.com/shugaoye/KPCLibPy.git
$ cd KPCLibPy
$ pip install -r requirements.txt
$ cd src
$ python3 ./nubia_main.py

For normal user, KPCLibPy can be installed using pip.

1
2
$ pip install kpclibpy
$ keepass

image01

Docker image

A Dockr image - docker-mono can be used on Linux or Windows 10 (WSL).

在PassXYZ中每个账户是与数据库一一对应的。当有需要时,如何建立一个新的账户呢?一般来说,可以通过以下三种方式建立新账户:

  1. 新安装时,可以在注册页面建立新账户;
  2. 在登陆页面,点击注册按钮建立新账户;
  3. 在登陆或注册页面,点击导入按钮,导入已有的KeePass数据库亦可建立新账户。

对于上述1、2项的两种情况,即,新安装或在登陆页面建立新账户,可以参考以下的动画图片:

生成新用户

用户通过导入已有的KeePass数据库建立新账户,可以参考文章如何导入KeePass数据文件

There are multiple ways to create a new account in PassXYZ. In this article, we discuss three major approaches that can be used for most of the cases.

  1. For a new installation, a new account can be created in the SignUp page;
  2. In the Login page, select the SignUp button on the toolbar to create a new account;
  3. In either SignUp or Login page, select the Import button on the toolbar to import an existing KeePass database so as to create a new account.

For the cases 1 and 2, Please refer to the below animated picture on how to create a new account:

Create a new user

To import an existing KeePass database for creating a new account, please refer to the article Import KeePass Data.

There are built-in icons in PassXYZ and users can change the icon of an entry or a group using the built-in icons. However, users may want to use their own icons as well. PassXYZ uses KeePassLib as the base for password management. KeePassLib does support custom icons, but this function can be used only on Windows platform. However, PassXYZ needs to support three platforms (iOS, Android and Windows). In the version 1.1.9 of KPCLib, the custom icon can be supported on all three platforms by using Skiasharp library from Xamarin. KPCLib is a modified version of KeePassLib and the source code can be found in GitHub.

In version PassXYZ 2.1.1/PassXYZ Cloud 2.4.1, KPCLib is updated to 1.1.9, so custom icons can be used from this version onwards. Please refer to the below animated picture on how to use custom icons.

change_icons

From the above figure, we can see that users can access “Change Icon” option in the context menu of an entry or a group. After selecting “Change Icon” option, a page with built-in icons will be listed. There is a toolbar item “+” at the top of the page. This toolbar item can be used to add a custom icon as we can see from the above figure.

Requirements of custom icon

  1. The icon must be a square with at least 96x96 pixels
  2. in JPEG or PNG format

How to remove a custom icon

After a custom icon is added, users can removed it as well if needed. Please refer to the below animated picture on how to remove a custom icon.

remove_icons

As you can see in the above figure, users can delete a custom icon from the context menu of the custom icon.

PassXYZ can import and export different file types through file type or sharing supported by operating system. However, different systems handle file type and sharing slightly different. Users may have difficulties to use file type or sharing to import or export. I can still see questions from the user’s feedback concerning how to import a KeePass file. In version PassXYZ 2.1.1/PassXYZ Cloud 2.4.1, a simple option is added to simplify the import of KeePass data file.

In the toolbar of both login and sign-up page, an import option is added as shown in the below animated picture.

Import

After choosing this toolbar item, the system file explorer will be shown. In the above figure, the file explorer of Android is shown. It is very similar in either iOS or Windows. After selecting the KeePass data file from file explorer, the imported data file can be accessed in PassXYZ.

To find more on import and export, please refer to another article Import and Export of PassXYZ data files.

PassXYZ可以通过文件类型和系统的分享功能实现各种类型文件的导入和导出。由于不同系统的文件类型处理和分享功能略有不同,用户在使用时可能会碰到一些困难。因为常会在用户反馈中看到询问如何导入KeePass数据文件的问题,所以在版本PassXYZ 2.1.1/PassXYZ Cloud 2.4.1中,增加了一个简单的导入选项。

在登陆和注册页面的工具栏中,都增加了一个导入的图标,如下面的动画图片所示:

导入

选择这个导入图标按钮后,便进入系统的文件浏览界面。上图所示的是Android系统的文件浏览界面。在文件浏览界面中选择所要导入的KeePass数据文件后,即可在PassXYZ中打开KeePass文件了。

进一步了解各类文件的导入和导出,请参考文章PassXYZ数据文件的导入和导出

0%