未验证 提交 4fdfb640 编写于 作者: O openharmony_ci 提交者: Gitee

!14250 修改图片链接格式,不需翻译。

Merge pull request !14250 from liyan/monthly_20221018
......@@ -73,4 +73,5 @@ The **module.json5** of a browser application is as follows:
4. If **type** in the passed **want** parameter is specified and is included in **type** under **skills**, the matching is successful.
2. When there are multiple matching applications, a dialog box is displayed for you to select one of them.
<img src="figures/stage-want1.png" alt="stage-want1" style="zoom:80%;" />
![stage-want1](figures/stage-want1.png)
......@@ -6,10 +6,12 @@
[Context](../reference/apis/js-apis-inner-application-context.md) is the context of an object in an application. It provides basic information about the application, for example, **resourceManager**, **applicationInfo**, **dir** (application development path), and **area** (encrypted area). It also provides basic methods such as **createBundleContext()** and **getApplicationContext()**. The UIAbility component and ExtensionAbility derived class components have their own **Context** classes, for example, the base class **Context**, **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, **ExtensionContext**, and **ServiceExtensionContext**.
- The figure below illustrates the inheritance relationship of contexts.
<img src="figures/context-inheritance.png" alt="context-inheritance" style="zoom: 50%;" />
![context-inheritance](figures/context-inheritance.png)
- The figure below illustrates the holding relationship of contexts.
<img src="figures/context-holding.png" alt="context-holding" style="zoom:50%;" />
![context-holding](figures/context-holding.png)
- The following describes the information provided by different contexts.
- [UIAbilityContext](../reference/apis/js-apis-inner-application-uiAbilityContext.md): Each UIAbility has the **Context** attribute, which provides APIs to operate the ability, obtain the ability configuration, and more.
......@@ -89,7 +91,8 @@ The following table describes the application development paths obtained from co
The capability of obtaining the application development path is provided by the base class **Context**. This capability is also provided by **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, and **ExtensionContext**. However, the paths obtained from different contexts may differ, as shown below.
**Figure 1** Application development paths obtained from context
<img src="figures/context-dir.png" alt="context-dir" style="zoom: 50%;" />
![context-dir](figures/context-dir.png)
- Obtain the application-level path through **ApplicationContext**. It is recommended that global application information be stored in this path. Files stored in this path will be deleted only when the application is uninstalled.
| Name| Path|
......@@ -174,7 +177,7 @@ The base class **Context** provides the [createBundleContext(bundleName:string)]
>
> - Request the **ohos.permission.GET_BUNDLE_INFO_PRIVILEGED** permission. For details, see [Permission Application Guide](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file).
>
> - This is a system API and cannot be called by third-party applications.
> - This is a system API and cannot be called by third-party applications.
For example, application information displayed on the home screen includes the application name and icon. The home screen application calls the foregoing method to obtain the context information, so as to obtain the resource information including the application name and icon.
......@@ -189,7 +192,7 @@ The base class **Context** provides the [createBundleContext(bundleName:string)]
// ...
}
}
```
```
- Call **createModuleContext(bundleName:string, moduleName:string)** to obtain the context of a specified module of another application. After obtaining the context, you can obtain the resource information of that module.
> **NOTE**
......@@ -198,7 +201,7 @@ The base class **Context** provides the [createBundleContext(bundleName:string)]
>
> - Request the **ohos.permission.GET_BUNDLE_INFO_PRIVILEGED** permission. For details, see [Permission Application Guide](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file).
>
> - This is a system API and cannot be called by third-party applications.
> - This is a system API and cannot be called by third-party applications.
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
......
......@@ -67,7 +67,7 @@ Users often need to share data (such as a text or an image) from one application
For example, when **"ability.picker.type"** is **"application/pdf"**, **"ability.picker.fileNames"** is **"["APIs.pdf"]"**, and **"ability.picker.fileSizes"** is **"[350 \* 1024]"**, the application selector is displayed as follows:
<img src="figures/stage-want2.png" alt="stage-want2" style="zoom:50%;" />
![stage-want2](figures/stage-want2.png)
In the preceding code, the **ability.want.params.INTENT** field is nested Want. In this field, **action** and **type** are used for implicit matching by the application selector. For details about implicit matching, see [Matching Rules of Implicit Want](explicit-implicit-want-mappings.md#matching-rules-of-implicit-want). After the user selects an application, the nested Want of the **ability.want.params.INTENT** field is passed to that application.
......
......@@ -61,7 +61,8 @@ The system matches the [action](../reference/apis/js-apis-ability-wantConstant.m
- If **action** in the passed **want** parameter is specified, and **actions** under **skills** of an ability is specified but does not contain **action** in the passed **want** parameter, the matching fails.
**Figure 1** Matching rules of action in the want parameter
<img src="figures/want-action.png" alt="want-action" style="zoom:80%;" />
![want-action](figures/want-action.png)
### Matching Rules of entities in the want Parameter
......@@ -78,8 +79,9 @@ The system matches the [entities](../reference/apis/js-apis-ability-wantConstant
- If **entities** in the passed **want** parameter is specified, and **entities** under **skills** of an ability is specified but does not contain **entities** in the passed **want** parameter, the matching fails.
Figure 2 Matching rule of entities in the want parameter
<img src="figures/want-entities.png" alt="want-entities" style="zoom:80%;" />
Figure 2 Matching rule of entities in the want parameter
![want-entities](figures/want-entities.png)
### Matching Rules of uri and type in the want Parameter
......@@ -87,7 +89,8 @@ The system matches the [entities](../reference/apis/js-apis-ability-wantConstant
When the **uri** and **type** parameters are specified in the **want** parameter to initiate a component startup request, the system traverses the list of installed components and matches the **uris** array under **skills** of the abilities one by one. If one of the **uris** arrays under **skills** matches the **uri** and **type** in the passed **want**, the matching is successful.
Figure 3 Matching rules when uri and type are specified in the want parameter
<img src="figures/want-uri-type1.png" alt="want-uri-type1" style="zoom: 80%;" />
![want-uri-type1](figures/want-uri-type1.png)
There are four combinations of **uri** and **type** settings. The matching rules are as follows:
......@@ -113,7 +116,8 @@ To simplify the description, **uri** and **type** passed in the **want** paramet
Figure 4 Matching rules of uri and type in the want parameter
<img src="figures/want-uri-type2.png" alt="want-uri-type2" style="zoom:80%;" />
![want-uri-type2](figures/want-uri-type2.png)
### Matching Rules of uri
......
......@@ -35,8 +35,9 @@ OpenHarmony provides a set of APIs for you to implement continuation in your app
The following figure shows the continuation architecture.
**Figure 1** Continuation architecture
<img src="figures/hop-structure.png" alt="hop-structure" style="zoom:80%;" />
**Figure 1** Continuation architecture
![hop-structure](figures/hop-structure.png)
- Cross-device migration task management: The initiator accepts a migration request from the user, provides a migration entry, and displays the migration result. (This capability is unavailable yet.)
......
......@@ -92,7 +92,8 @@ Before using EventHub, you must obtain an EventHub object, which is provided by
**globalThis** is a global object inside the [ArkTS engine instance](thread-model-stage.md) and can be used by UIAbility, ExtensionAbility, and Page inside the engine. Therefore, you can use **globalThis** for data synchronization.
**Figure 1** Using globalThis for data synchronization
<img src="figures/globalThis1.png" alt="globalThis1" style="zoom:67%;" />
![globalThis1](figures/globalThis1.png)
The following describes how to use **globalThis** in three scenarios. Precautions are provided as well.
......@@ -209,6 +210,7 @@ To implement data synchronization between the UIAbility and ExtensionAbility com
### Precautions for Using globalThis
**Figure 2** Precautions for globalThis
![globalThis2](figures/globalThis2.png)
- In the stage model, all the UIAbility components in a process share one ArkTS engine instance. When using **globalThis**, do not store objects with the same name. For example, if AbilityA and AbilityB use **globalThis** to store two objects with the same name, the object stored earlier will be overwritten.
......
......@@ -197,7 +197,7 @@ This section describes how to start the UIAbility of another application through
The following figure shows the effect. When you click **Open PDF**, a dialog box is displayed for you to select.
<img src="figures/uiability-intra-device-interaction.png" alt="uiability-intra-device-interaction" style="zoom:50%;" />
![uiability-intra-device-interaction](figures/uiability-intra-device-interaction.png)
3. To stop the **UIAbility** instance after the document application is used, call **terminateSelf()**.
......@@ -445,7 +445,7 @@ The following figure shows the ability call process.
**Figure 1** Ability call process
<img src="figures/call.png" alt="call" style="zoom:67%;" />
![call](figures/call.png)
- The caller ability uses **startAbilityByCall** to obtain a caller object and uses **call()** of the caller object to send data to the callee ability.
......
......@@ -19,7 +19,7 @@ Each time [startAbility()](../reference/apis/js-apis-inner-application-uiAbility
**Figure 1** Demonstration effect in singleton mode
<img src="figures/uiability-launch-type1.png" alt="uiability-launch-type1" width="40%;" />
![uiability-launch-type1](figures/uiability-launch-type1.png)
> **NOTE**
>
......@@ -49,7 +49,7 @@ In standard mode, each time [startAbility()](../reference/apis/js-apis-inner-app
**Figure 2** Demonstration effect in standard mode
<img src="figures/standard-mode.png" alt="standard-mode" width="40%;" />
![standard-mode](figures/standard-mode.png)
To use the standard mode, set **launchType** in the [module.json5 configuration file](../quick-start/module-configuration-file.md) to **standard**.
......@@ -75,7 +75,7 @@ The **specified** mode is used in some special scenarios. For example, in a docu
**Figure 3** Demonstration effect in specified mode
<img src="figures/uiability-launch-type2.png" alt="uiability-launch-type2" style="zoom:50%;" />
![uiability-launch-type2](figures/uiability-launch-type2.png)
For example, there are EntryAbility and SpecifiedAbility, and the launch type of SpecifiedAbility is set to **specified**. You are required to start SpecifiedAbility from EntryAbility.
......
......@@ -7,8 +7,9 @@ When a user opens, switches, and returns to an application, the UIAbility instan
The lifecycle of UIAbility has four states: **Create**, **Foreground**, **Background**, and **Destroy**, as shown in the figure below.
**Figure 1** UIAbility lifecycle states
<img src="figures/Ability-Life-Cycle.png" alt="Ability-Life-Cycle" style="zoom:50%;" />
**Figure 1** UIAbility lifecycle states
![Ability-Life-Cycle](figures/Ability-Life-Cycle.png)
## Description of Lifecycle States
......@@ -36,8 +37,9 @@ export default class EntryAbility extends UIAbility {
After the UIAbility instance is created but before it enters the **Foreground** state, the system creates a WindowStage instance and triggers the **onWindowStageCreate()** callback. You can set UI loading and WindowStage event subscription in the callback.
**Figure 2** WindowStageCreate and WindowStageDestory
<img src="figures/Ability-Life-Cycle-WindowStage.png" alt="Ability-Life-Cycle-WindowStage" style="zoom:50%;" />
**Figure 2** WindowStageCreate and WindowStageDestory
![Ability-Life-Cycle-WindowStage](figures/Ability-Life-Cycle-WindowStage.png)
In the **onWindowStageCreate()** callback, use [loadContent()](../reference/apis/js-apis-window.md#loadcontent9-2) to set the page to be loaded, and call [on('windowStageEvent')](../reference/apis/js-apis-window.md#onwindowstageevent9) to subscribe to [WindowStage events](../reference/apis/js-apis-window.md#windowstageeventtype9), for example, having or losing focus, or becoming visible or invisible.
......
......@@ -5,8 +5,9 @@
[Want](../reference/apis/js-apis-app-ability-want.md) is used as the carrier to transfer information between application components. It is used as a parameter of **startAbility()** to specify the startup target and information that needs to be carried during startup, for example, **bundleName** and **abilityName**, which respectively indicate the bundle name of the target ability and the ability name in the bundle. For example, when UIAbilityA starts UIAbilityB and needs to transfer some data to UIAbilityB, it can use Want to transfer the data.
**Figure 1** Want usage
<img src="figures/usage-of-want.png" alt="usage-of-want" style="zoom:80%;" />
**Figure 1** Want usage
![usage-of-want](figures/usage-of-want.png)
## Types of Want
......
......@@ -476,7 +476,7 @@ Check whether xDevice runs properly.
The COM port whose **type** is **cmd** corresponds to the AT command serial port on the board. The port is used to send commands to the device. In the example, the **ChA(COM20)** serial port is used.
<img src="figures/L0-1.PNG" alt="L0-1" style="zoom:67%;" />
![L0-1](figures/L0-1.PNG)
IP camera devices have two connection modes. One is to connect through the local serial port, and the other is to connect through the IP address of the local area network.
......@@ -492,7 +492,7 @@ Check whether xDevice runs properly.
Add an NFS sharing path, for example, **D:\HS\NFS_Share_File -public –alldirs**. Note that the FTP IP address 192.168.1.10 is the IP address of the development board.
<img src="figures/NFS-2.PNG" style="zoom:75%;" />
![](figures/NFS-2.PNG)
3. Stop the NFS server and restart the NFS server to make the added sharing path take effect.
......
......@@ -72,4 +72,6 @@
4. want内type不为空,且被skills内type包含,匹配成功。
2. 当有多个匹配应用时,会被应用选择器展示给用户进行选择。<img src="figures/stage-want1.png" alt="stage-want1" style="zoom:50%;" />
2. 当有多个匹配应用时,会被应用选择器展示给用户进行选择。
![stage-want1](figures/stage-want1.png)
......@@ -6,10 +6,12 @@
[Context](../reference/apis/js-apis-inner-application-context.md)是应用中对象的上下文,其提供了应用的一些基础信息,例如resourceManager(资源管理)、applicationInfo(当前应用信息)、dir(应用开发路径)、area(文件分区)等,以及应用的一些基本方法,例如createBundleContext()、getApplicationContext()等。UIAbility组件和各种ExtensionAbility派生类组件都有各自不同的Context类。分别有基类Context、ApplicationContext、AbilityStageContext、UIAbilityContext、ExtensionContext、ServiceExtensionContext等Context。
- 各类Context的继承关系
<img src="figures/context-inheritance.png" alt="context-inheritance" style="zoom: 50%;" />
![context-inheritance](figures/context-inheritance.png)
- 各类Context的持有关系
<img src="figures/context-holding.png" alt="context-holding" style="zoom:50%;" />
![context-holding](figures/context-holding.png)
- 各类Context的获取方式
- 获取[UIAbilityContext](../reference/apis/js-apis-inner-application-uiAbilityContext.md)。每个UIAbility中都包含了一个Context属性,提供操作Ability、获取Ability的配置信息、应用向用户申请授权等能力。
......@@ -93,8 +95,9 @@
获取路径的能力是基类Context中提供的能力,因此在ApplicationContext、AbilityStageContext、UIAbilityContext和ExtensionContext中均可以获取,在各类Context中获取到的路径会有一些差别,具体差别如下图所示。
**图1** Context中获取的应用开发路径
<img src="figures/context-dir.png" alt="context-dir" style="zoom: 50%;" />
**图1** Context中获取的应用开发路径
![context-dir](figures/context-dir.png)
- 通过ApplicationContext获取的应用级别路径。应用全局信息建议存放的路径,存放在此路径的文件内容仅在应用卸载时会被删除。
| 属性 | 路径 |
......@@ -306,4 +309,5 @@ export default class EntryAbility extends UIAbility {
应用需要获取用户的隐私信息或使用系统能力时,例如获取位置信息、访问日历、使用相机拍摄照片或录制视频等,需要向用户申请授权,示意效果如下图所示。具体使用请参见[访问控制授权申请指导](../security/accesstoken-guidelines.md)
**图2** 向用户申请日历访问授权
<img src="figures/application-context-stage.png" alt="application-context-stage" style="zoom:50%;" />
\ No newline at end of file
![application-context-stage](figures/application-context-stage.png)
\ No newline at end of file
......@@ -65,7 +65,8 @@
- "ability.picker.fileNames"与"ability.picker.fileSizes"为数组,其有一一对应关系。
例如:当"ability.picker.type"为“application/pdf”,"ability.picker.fileNames"为“["接口文档.pdf"]”,"ability.picker.fileSizes"为“[350 \* 1024]”时,应用选择器将以下形式展示。
<img src="figures/stage-want2.png" alt="stage-want2" style="zoom:50%;" />
![stage-want2](figures/stage-want2.png)
示例代码中“ability.want.params.INTENT”字段是一个嵌套Want,内部所含action、type等字段将由应用选择器进行隐式匹配,具体隐式匹配规则可参考[隐式Want匹配原理详解](explicit-implicit-want-mappings.md#隐式want匹配原理详解)。当用户选择具体应用后,“ability.want.params.INTENT”字段的嵌套Want将传递至所选应用。
......
......@@ -59,7 +59,9 @@
- 调用方传入的want参数的action不为空,待匹配Ability的skills配置中的actions不为空且不包含调用方传入的want参数的action,则action匹配失败。
**图1** want参数的action匹配规则  <img src="figures/want-action.png" alt="want-action" style="zoom:80%;" />
**图1** want参数的action匹配规则
![want-action](figures/want-action.png)
### want参数的entities匹配规则
......@@ -76,16 +78,18 @@
- 调用方传入的want参数的entities不为空,待匹配Ability的skills配置中的entities不为空且不完全包含调用方传入的want参数的entities,则entities匹配失败。
**图2** want参数的entities匹配规则
<img src="figures/want-entities.png" alt="want-entities" style="zoom:80%;" />
**图2** want参数的entities匹配规则
![want-entities](figures/want-entities.png)
### want参数的uri和type匹配规则
调用方传入的want参数中设置uri和type参数发起组件启动请求,系统会遍历当前系统已安装的组件列表,并逐个匹配待匹配Ability的skills配置中的uris数组,如果待匹配Ability的skills配置中的uris数组中只要有一个可以匹配调用方传入的want参数中设置的uri和type即为匹配成功。
**图3** want参数中uri和type皆不为空时的匹配规则
<img src="figures/want-uri-type1.png" alt="want-uri-type1" style="zoom: 80%;" />
**图3** want参数中uri和type皆不为空时的匹配规则
![want-uri-type1](figures/want-uri-type1.png)
实际应用中,uri和type共存在四种情况,下面将讲解四种情况的具体匹配规则:
......@@ -110,8 +114,9 @@
下图为了简化描述,称want中传入的uri为w_uri,称want中传入的type为w_type, 待匹配Ability的skills配置中uris为s_uris,其中每个元素为s_uri;按自上而下顺序匹配。
**图4** want参数中uri和type的具体匹配规则
<img src="figures/want-uri-type2.png" alt="want-uri-type2" style="zoom:80%;" />
**图4** want参数中uri和type的具体匹配规则
![want-uri-type2](figures/want-uri-type2.png)
### uri匹配规则
......
......@@ -35,8 +35,9 @@ OpenHarmony流转提供了一组API库,可让用户应用程序更轻松、快
流转架构如下图所示。
**图1** 流转架构图
<img src="figures/hop-structure.png" alt="hop-structure" style="zoom:80%;" />
**图1** 流转架构图
![hop-structure](figures/hop-structure.png)
- 跨端迁移任务管理:在迁移发起端,接受用户迁移的意图,提供迁移流转入口,迁移结果显示等能力。(该能力尚未构建。)
......
......@@ -92,7 +92,8 @@ EventHub提供了UIAbility组件/ExtensionAbility组件级别的事件机制,
globalThis是ArkTS引擎实例内部的一个全局对象,引擎内部的UIAbility/ExtensionAbility/Page都可以使用,因此可以使用globalThis全局对象进行数据同步。
**图1** 使用globalThis进行数据同步
<img src="figures/globalThis1.png" alt="globalThis1" style="zoom:67%;" />
![globalThis1](figures/globalThis1.png)
如上图所示,下面从如下三个场景和一个注意点来介绍globalThis的使用:
......@@ -209,6 +210,7 @@ globalThis为[ArkTS引擎实例](thread-model-stage.md)下的全局对象,可
### globalThis使用的注意事项
**图2** globalThis注意事项
![globalThis2](figures/globalThis2.png)
- Stage模型下进程内的UIAbility组件共享ArkTS引擎实例,使用globalThis时需要避免存放相同名称的对象。例如AbilityA和AbilityB可以使用globalThis共享数据,在存放相同名称的对象时,先存放的对象会被后存放的对象覆盖。
......
......@@ -196,7 +196,8 @@ UIAbility是系统调度的最小单元。在设备内的功能模块之间跳
```
效果示意如下图所示,点击“打开PDF文档”时,会弹出选择框供用户选择。
<img src="figures/uiability-intra-device-interaction.png" alt="uiability-intra-device-interaction" style="zoom:50%;" />
![uiability-intra-device-interaction](figures/uiability-intra-device-interaction.png)
3. 在文档应用使用完成之后,如需要停止当前UIAbility实例,通过调用terminateSelf()方法实现。
......@@ -441,8 +442,9 @@ Call调用的使用场景主要包括:
Call调用示意图如下所示。
**图1** Call调用示意图
<img src="figures/call.png" alt="call" style="zoom:67%;" />
**图1** Call调用示意图
![call](figures/call.png)
- CallerAbility调用startAbilityByCall接口获取Caller,并使用Caller对象的call方法向CalleeAbility发送数据。
......
......@@ -17,8 +17,9 @@ singleton启动模式为单实例模式,也是默认情况下的启动模式
每次调用startAbility()方法时,如果应用进程中该类型的UIAbility实例已经存在,则复用系统中的UIAbility实例。系统中只存在唯一一个该UIAbility实例,即在最近任务列表中只存在一个该类型的UIAbility实例。
**图1** 单实例模式演示效果
<img src="figures/uiability-launch-type1.png" alt="uiability-launch-type1" style="zoom:50%;" />
**图1** 单实例模式演示效果
![uiability-launch-type1](figures/uiability-launch-type1.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 应用的UIAbility实例已创建,该UIAbility配置为单实例模式,再次调用startAbility()方法启动该UIAbility实例,此时只会进入该UIAbility的[onNewWant()](../reference/apis/js-apis-app-ability-uiAbility.md#abilityonnewwant)回调,不会进入其onCreate()和onWindowStageCreate()生命周期回调。
......@@ -45,8 +46,9 @@ singleton启动模式为单实例模式,也是默认情况下的启动模式
standard启动模式为标准实例模式,每次调用startAbility()方法时,都会在应用进程中创建一个新的该类型UIAbility实例。即在最近任务列表中可以看到有多个该类型的UIAbility实例。这种情况下可以将UIAbility配置为standard(标准实例模式)。
**图2** 标准实例模式演示效果
<img src="figures/standard-mode.png" alt="standard-mode" style="zoom:50%;" />
**图2** 标准实例模式演示效果
![standard-mode](figures/standard-mode.png)
standard启动模式的开发使用,在[module.json5配置文件](../quick-start/module-configuration-file.md)中的"launchType"字段配置为"standard"即可。
......@@ -72,8 +74,9 @@ specified启动模式为指定实例模式,针对一些特殊场景使用(
在UIAbility实例创建之前,允许开发者为该实例创建一个唯一的字符串Key,创建的UIAbility实例绑定Key之后,后续每次调用startAbility()方法时,都会询问应用使用哪个Key对应的UIAbility实例来响应startAbility()请求。运行时由UIAbility内部业务决定是否创建多实例,如果匹配有该UIAbility实例的Key,则直接拉起与之绑定的UIAbility实例,否则创建一个新的UIAbility实例。
**图3** 指定实例模式演示效果
<img src="figures/uiability-launch-type2.png" alt="uiability-launch-type2" style="zoom:50%;" />
**图3** 指定实例模式演示效果
![uiability-launch-type2](figures/uiability-launch-type2.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 应用的UIAbility实例已创建,该UIAbility配置为指定实例模式,再次调用startAbility()方法启动该UIAbility实例,且[AbilityStage](abilitystage.md)的[onAcceptWant()](../reference/apis/js-apis-app-ability-abilityStage.md#abilitystageonacceptwant)回调匹配到一个已创建的UIAbility实例。此时,再次启动该UIAbility时,只会进入该UIAbility的[onNewWant()](../reference/apis/js-apis-app-ability-uiAbility.md#abilityonnewwant)回调,不会进入其onCreate()和onWindowStageCreate()生命周期回调。
......
......@@ -7,8 +7,9 @@
UIAbility的生命周期包括Create、Foreground、Background、Destroy四个状态,如下图所示。
**图1** UIAbility生命周期状态
<img src="figures/Ability-Life-Cycle.png" alt="Ability-Life-Cycle" style="zoom:50%;" />
**图1** UIAbility生命周期状态
![Ability-Life-Cycle](figures/Ability-Life-Cycle.png)
## 生命周期状态说明
......@@ -36,8 +37,9 @@ export default class EntryAbility extends UIAbility {
UIAbility实例创建完成之后,在进入Foreground之前,系统会创建一个WindowStage。WindowStage创建完成后会进入onWindowStageCreate()回调,可以在该回调中设置UI界面加载、设置WindowStage的事件订阅。
**图2** WindowStageCreate和WindowStageDestory状态
<img src="figures/Ability-Life-Cycle-WindowStage.png" alt="Ability-Life-Cycle-WindowStage" style="zoom:50%;" />
**图2** WindowStageCreate和WindowStageDestory状态
![Ability-Life-Cycle-WindowStage](figures/Ability-Life-Cycle-WindowStage.png)
在onWindowStageCreate()回调中通过loadContent()方法设置应用要加载的页面并根据需要订阅WindowStage的[事件](../reference/apis/js-apis-window.md#windowstageeventtype9)(获焦/失焦、可见/不可见)。
......
......@@ -5,9 +5,9 @@
[Want](../reference/apis/js-apis-app-ability-want.md)是对象间信息传递的载体,可以用于应用组件间的信息传递。其使用场景之一是作为startAbility()的参数,包含了指定的启动目标以及启动时需携带的相关数据,如bundleName和abilityName字段分别指明目标Ability所在应用的包名以及对应包内的Ability名称。当UIAbilityA启动UIAbilityB并需要传入一些数据给UIAbilityB时,Want可以作为一个载体将数据传给UIAbilityB。
**图1** Want用法示意
<img src="figures/usage-of-want.png" alt="usage-of-want" style="zoom:80%;" />
**图1** Want用法示意
![usage-of-want](figures/usage-of-want.png)
## Want的类型
......
......@@ -12,7 +12,7 @@
OpenHarmony软件栈中包含了多个角色,因此API也分作多种类型。
<img src="figures/API-Category.png" width="800" />
![](figures/API-Category.png)
不同的API类型其兼容性要求也不一样,具体如下表所述:
......@@ -60,7 +60,7 @@ OpenHarmony的目标是构建面向万物互联时代的新一代操作系统,
### API评审流程
API评审流程如下:
<img src="figures/API-Workflow.png" width="800" />
![](figures/API-Workflow.png)
主要过程说明:
......
......@@ -476,7 +476,7 @@ run指令基本使用方法如下。
type为cmd的com口对应板子上的AT命令串口,用于对设备发送指令,示例中配置为ChA(COM20)串口号。
<img src="figures/L0-1.PNG" alt="L0-1" style="zoom:67%;" />
![L0-1](figures/L0-1.PNG)
ipcamera设备有两种连接方式,一种是本地串口连接,一种是通过局域网ip连接。
......@@ -490,17 +490,17 @@ run指令基本使用方法如下。
2. 配置输出->编辑输出表文件。
<img src="figures/NFS-1.PNG" style="zoom: 67%;" />
![](figures/NFS-1.PNG)
3. 添加路径NFS共享路径(如:D:\HS\NFS_Share_File -public –alldirs),这里要注意ftp的IP地址192.168.1.10为开发板的IP。
<img src="figures/NFS-2.PNG" style="zoom:75%;" />
![](figures/NFS-2.PNG)
4. 停止NFS服务器->重启运行NFS服务器使刚才添加的共享路径生效。
5. 找到ipcamera设备在PC上面映射的网口:控制面板->网络和Internet->网络共享中心->以太网状态->以太网属性->手动设置IP地址为:192.168.1.11。
<img src="figures/NFS-3.PNG" style="zoom:67%;" />
![](figures/NFS-3.PNG)
3. 修改根目录中的user_config.xml文件,示例如下。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册