openharmony 鸿蒙 fa-stage-interaction-overview

2023-02-03 浏览 (881)

Component Interaction Between the FA Model and Stage Model

The FA model is supported by API version 8 and earlier versions, and the stage model is recommended since API version 9. The FA model and stage model have their respective components. The FA model provides three types of application components: PageAbility, ServiceAbility, and DataAbility. The stage model provides two types of application components: UIAbility and ExtensionAbility.

You cannot use both models for the development of an application (see the figure below). However, a device (system) can contain applications developed on different models (scenario 3 in the figure below). In this case, their components may interact with each other.

Figure 1 Coexistent application components of the FA model and stage model

coexistence-of-FAandStage

The following table lists the possible interaction scenarios and the concerns of each scenario.

Table 1 Application component interaction scenarios

Interaction ScenarioConcerns
Starting a UIAbility from the FA ModelSet bundleName and abilityName in the want parameter to the bundle name and ability name of the UIAbility in the stage model.
Connecting to a ServiceExtensionAbility from the FA ModelSet bundleName and abilityName in the want parameter to the bundle name and ability name of the ServiceExtensionAbility in the stage model.
Accessing a DataShareExtensionAbility from the FA ModelNo code modification is required. However, you need to understand the API compatibility of DataShareHelper and DataAbilityHelper.
Starting a PageAbility from the Stage ModelSet bundleName and abilityName in the want parameter to the bundle name and ability name of the PageAbility in the FA model.
Connecting to a ServiceAbility from the Stage ModelSet bundleName and abilityName in the want parameter to the bundle name and ability name of the ServiceAbility in the FA model.
Accessing a DataAbility from the Stage ModelThis type of access is not supported.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙Obtaining Reasons for Abnormal Application Exits

harmony 鸿蒙UIAbility Backup and Restore

harmony 鸿蒙Using Explicit Want to Start an Application Component

harmony 鸿蒙Introduction to Ability Kit

harmony 鸿蒙AbilityStage Component Container

harmony 鸿蒙Accessing a DataAbility

harmony 鸿蒙Accessing a DataShareExtensionAbility from the FA Model

harmony 鸿蒙Common action and entities Values (Not Recommended)

harmony 鸿蒙API Switching Overview

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/10f9c0aa88c749d4b592096dfd388b36