• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# dmsfwk_lite
2
3## Introduction
4
5The 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.
6
7![](figures/en-us_image_0000001081284974.png)
8
9## Directory Structure
10
11The table below describes the directory structure of the dmsfwk_lite source code.
12
13**Table 1** Directory structure of the major source code
14
15| Directory       | Description                |
16| ----------- | -------------------- |
17| dmsfwk_lite | Implementation of dmsfwk_lite|
18
19The source code directory structure of dmsfwk_lite is as follows:
20
21```
22├── BUILD.gn
23├── include
24│  ├── dmslite.h        # Header file for the open APIs provided by dmsfwk_lite
25│  ├── dmslite_check_remote_permission.h     # Header file for the permission management module of dmsfwk_lite
26│  ├── dmslite_famgr.h                       # Header file for the FA management module of dmsfwk_lite
27│  ├── dmslite_inner_common.h                # Internal common file of dmsfwk_lite
28│  ├── dmslite.h                             # Header file for the implementation of the dmsfwk_lite service
29│  ├── dmslite_log.h                         # Header file for the log module
30│  ├── dmslite_parser.h                  # Header file for the distributed message parsing module
31│  ├── dmslite_tlv_common.h                  # Header file for the TLV data parsing module
32│  └── dmslite_session.h                     # Header file for the inter-device communication module
33├── readme.md
34├── LICENSE
35├── source
36    ├── distributed_schedule_service.c
37    ├── dmslite.c
38    ├── dmslite_check_remote_permission.c
39    ├── dmslite_famgr.c
40    ├── dmslite_msg_parser.c
41    ├── dmslite_tlv_common.c
42    └── dmslite_session.c
43```
44
45## Constraints
46
47**Programming language**: C/C++
48
49**Networking environment**: The local and remote devices must be on the same LAN and can ping each other.
50
51**Operating system**: OpenHarmony
52
53**Remote startup**:
54
55-   Only FAs can be started remotely.
56-   Before the remote startup, ensure that the distributed networking between the local and remote devices is successful. Otherwise, the remote startup fails.
57
58## Usage
59
60- **Building**
61
62  The code of dmsfwk_lite is stored in the following directory:
63
64  ```
65  foundation/ability/dmsfwk_lite
66  ```
67
68  When building the code for a specific platform, you must specify the target platform.
69
70  ```
71  hb build
72  ```
73
74- **Local device development** (taking FA startup as an example)
75
76  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.
77
78  ```
79  import ohos.aafwk.ability.Ability;
80  import ohos.aafwk.content.Want;
81  import ohos.bundle.ElementName;
82
83  // Create a Want instance that will be passed to the startAbility method.
84  Want want = new Want();
85  ElementName name = new ElementName(remote_device_id,       "ohos.dms.remote_bundle_name", "remote_ability_name");
86  want.setElement(name); // Add information about the target FA to the Want instance.
87  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.
88
89  // Start the remote FA on the remote device.
90  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.
91  ```
92
93- **Prerequisites**
94
95  The target FA with the specified bundle name must have been installed on the remote device.
96
97- **Execution** (taking FA startup as an example)
98
99  Call the **startAbility** method on the local device to start the target FA on the remote device.
100
101## Repositories Involved
102
103dmsfwk_lite
104
105[**dmsfwk\_lite**](https://gitee.com/openharmony/ability_dmsfwk_lite)
106