193360723Sopenharmony_ci# dmsfwk_lite
293360723Sopenharmony_ci
393360723Sopenharmony_ci## Introduction
493360723Sopenharmony_ci
593360723Sopenharmony_ciThe Lite Distributed Ability Manager Service Framework (dmsfwk_lite) component provides the capability of starting Feature Abilities (FAs) across devices and supports application collaboration in distributed scenarios. The following figure shows the architecture of dmsfwk_lite.
693360723Sopenharmony_ci
793360723Sopenharmony_ci![](figures/en-us_image_0000001081284974.png)
893360723Sopenharmony_ci
993360723Sopenharmony_ci## Directory Structure
1093360723Sopenharmony_ci
1193360723Sopenharmony_ciThe table below describes the directory structure of the dmsfwk_lite source code.
1293360723Sopenharmony_ci
1393360723Sopenharmony_ci**Table 1** Directory structure of the major source code
1493360723Sopenharmony_ci
1593360723Sopenharmony_ci| Directory       | Description                |
1693360723Sopenharmony_ci| ----------- | -------------------- |
1793360723Sopenharmony_ci| dmsfwk_lite | Implementation of dmsfwk_lite|
1893360723Sopenharmony_ci
1993360723Sopenharmony_ciThe source code directory structure of dmsfwk_lite is as follows:
2093360723Sopenharmony_ci
2193360723Sopenharmony_ci```
2293360723Sopenharmony_ci├── BUILD.gn
2393360723Sopenharmony_ci├── include
2493360723Sopenharmony_ci│  ├── dmslite.h        # Header file for the open APIs provided by dmsfwk_lite
2593360723Sopenharmony_ci│  ├── dmslite_check_remote_permission.h     # Header file for the permission management module of dmsfwk_lite
2693360723Sopenharmony_ci│  ├── dmslite_famgr.h                       # Header file for the FA management module of dmsfwk_lite
2793360723Sopenharmony_ci│  ├── dmslite_inner_common.h                # Internal common file of dmsfwk_lite
2893360723Sopenharmony_ci│  ├── dmslite.h                             # Header file for the implementation of the dmsfwk_lite service
2993360723Sopenharmony_ci│  ├── dmslite_log.h                         # Header file for the log module
3093360723Sopenharmony_ci│  ├── dmslite_parser.h                  # Header file for the distributed message parsing module
3193360723Sopenharmony_ci│  ├── dmslite_tlv_common.h                  # Header file for the TLV data parsing module
3293360723Sopenharmony_ci│  └── dmslite_session.h                     # Header file for the inter-device communication module
3393360723Sopenharmony_ci├── readme.md
3493360723Sopenharmony_ci├── LICENSE
3593360723Sopenharmony_ci├── source
3693360723Sopenharmony_ci    ├── distributed_schedule_service.c
3793360723Sopenharmony_ci    ├── dmslite.c
3893360723Sopenharmony_ci    ├── dmslite_check_remote_permission.c
3993360723Sopenharmony_ci    ├── dmslite_famgr.c
4093360723Sopenharmony_ci    ├── dmslite_msg_parser.c
4193360723Sopenharmony_ci    ├── dmslite_tlv_common.c
4293360723Sopenharmony_ci    └── dmslite_session.c
4393360723Sopenharmony_ci```
4493360723Sopenharmony_ci
4593360723Sopenharmony_ci## Constraints
4693360723Sopenharmony_ci
4793360723Sopenharmony_ci**Programming language**: C/C++
4893360723Sopenharmony_ci
4993360723Sopenharmony_ci**Networking environment**: The local and remote devices must be on the same LAN and can ping each other.
5093360723Sopenharmony_ci
5193360723Sopenharmony_ci**Operating system**: OpenHarmony
5293360723Sopenharmony_ci
5393360723Sopenharmony_ci**Remote startup**:
5493360723Sopenharmony_ci
5593360723Sopenharmony_ci-   Only FAs can be started remotely.
5693360723Sopenharmony_ci-   Before the remote startup, ensure that the distributed networking between the local and remote devices is successful. Otherwise, the remote startup fails.
5793360723Sopenharmony_ci
5893360723Sopenharmony_ci## Usage
5993360723Sopenharmony_ci
6093360723Sopenharmony_ci- **Building**
6193360723Sopenharmony_ci
6293360723Sopenharmony_ci  The code of dmsfwk_lite is stored in the following directory:
6393360723Sopenharmony_ci
6493360723Sopenharmony_ci  ```
6593360723Sopenharmony_ci  foundation/ability/dmsfwk_lite
6693360723Sopenharmony_ci  ```
6793360723Sopenharmony_ci  
6893360723Sopenharmony_ci  When building the code for a specific platform, you must specify the target platform.
6993360723Sopenharmony_ci  
7093360723Sopenharmony_ci  ```
7193360723Sopenharmony_ci  hb build
7293360723Sopenharmony_ci  ```
7393360723Sopenharmony_ci
7493360723Sopenharmony_ci- **Local device development** (taking FA startup as an example)
7593360723Sopenharmony_ci
7693360723Sopenharmony_ci  Create a **Want** instance to set the remote device ID, bundle name, and ability class name of the target FA and set the **Want.FLAG\_ABILITYSLICE\_MULTI\_DEVICE** flag to enable distributed startup.
7793360723Sopenharmony_ci
7893360723Sopenharmony_ci  ```
7993360723Sopenharmony_ci  import ohos.aafwk.ability.Ability;
8093360723Sopenharmony_ci  import ohos.aafwk.content.Want;
8193360723Sopenharmony_ci  import ohos.bundle.ElementName;
8293360723Sopenharmony_ci
8393360723Sopenharmony_ci  // Create a Want instance that will be passed to the startAbility method.
8493360723Sopenharmony_ci  Want want = new Want();
8593360723Sopenharmony_ci  ElementName name = new ElementName(remote_device_id,       "ohos.dms.remote_bundle_name", "remote_ability_name"); 
8693360723Sopenharmony_ci  want.setElement(name); // Add information about the target FA to the Want instance.
8793360723Sopenharmony_ci  want.setFlags(Want.FLAG_ABILITYSLICE_MULTI_DEVICE); // Set the multi-device startup flag. If this flag is not set, remote FA startup will be unavailable.
8893360723Sopenharmony_ci
8993360723Sopenharmony_ci  // Start the remote FA on the remote device.
9093360723Sopenharmony_ci  startAbility(want); // Start the specified FA based on the want parameter. If the name and type of the want parameter are different from those used in DevEco Studio, use the parameter name and type in DevEco Studio.
9193360723Sopenharmony_ci  ```
9293360723Sopenharmony_ci
9393360723Sopenharmony_ci- **Prerequisites**
9493360723Sopenharmony_ci
9593360723Sopenharmony_ci  The target FA with the specified bundle name must have been installed on the remote device.
9693360723Sopenharmony_ci
9793360723Sopenharmony_ci- **Execution** (taking FA startup as an example)
9893360723Sopenharmony_ci
9993360723Sopenharmony_ci  Call the **startAbility** method on the local device to start the target FA on the remote device.
10093360723Sopenharmony_ci
10193360723Sopenharmony_ci## Repositories Involved
10293360723Sopenharmony_ci
10393360723Sopenharmony_cidmsfwk_lite
10493360723Sopenharmony_ci
10593360723Sopenharmony_ci[**dmsfwk\_lite**](https://gitee.com/openharmony/ability_dmsfwk_lite)
106