| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 12-May-2024 | - | 38 | 35 | ||
| entry/ | 12-May-2024 | - | 1,371 | 1,117 | ||
| screenshots/device/ | 12-May-2024 | - | ||||
| .gitignore | D | 12-May-2024 | 121 | 8 | 8 | |
| README.md | D | 12-May-2024 | 1.3 KiB | 25 | 13 | |
| README_zh.md | D | 12-May-2024 | 2.2 KiB | 39 | 20 | |
| build-profile.json5 | D | 12-May-2024 | 1 KiB | 43 | 41 | |
| hvigorfile.js | D | 12-May-2024 | 168 | 2 | 1 | |
| package.json | D | 12-May-2024 | 298 | 15 | 15 |
README.md
1# StageCallAbility 2 3### Introduction 4 5This sample shows how to start an ability and use the **Call** function of the stage model, including starting another ability, creating a callee, and accessing the callee. 6 7### Usage 8 91. Start the demo app. The main ability is started, and **Call Sample** is displayed on the page. 10 112. Touch **Start Callee Ability**. **Callee Ability** is displayed on the page. 12 133. Switch to the **MainAbility** page and touch **Obtain Caller** to obtain the caller interface. The main ability is the caller, and the callee ability is the callee. This operation does not switch the **Callee Ability** page to the foreground. 14 154. In the text box below **Enter message to send**, enter a string, for example, "play music". 16 175. Touch **Send Message Through Call** to serialize the string entered and send the processed string to the callee. A message is displayed on the **MainAbility** page, indicating that the message is sent successfully. Switch to the **Callee Ability** page, and you can see the **play music** message sent by the caller. 18 196. Touch **Release Caller** to release the caller interface. After the caller is released, the main ability cannot send data to the callee ability. 20 21### Constraints 22 231. This sample can only be run on standard-system devices. 242. This sample is based on the stage model, which is supported from API version 9. 25
README_zh.md
1# StageCallAbility的创建与使用 2 3### 简介 4 5本示例展示了Stage模型启动Ability及Call功能的使用,包括拉起另一个Ability、创建Callee被调用端以及访问Callee被调用端。效果图如下: 6 7  8 9### 相关概念 10 11Call调用:Ability Call调用是Ability能力的扩展,它为Ability提供一种能够被外部调用的能力,使Ability既能被拉起到前台展示UI,也支持Ability在后台被创建并运行。应用开发者可通过Call调用,使用IPC通信实现不同Ability之间的数据共享。 12 13### 相关权限 14 15允许不同设备间的数据交换:ohos.permission.DISTRIBUTED_DATASYNC 16 17### 使用说明 18 191.启动应用,拉起MainAbility,页面正常显示**Call Sample**字样。 20 212.点击**启动Callee Ability**按钮,触发拉起CalleeAbility,页面显示**Callee Ability**字样。 22 233.切换到MainAbility的页面,点击**获取Caller**按钮获取Caller通信接口,MainAbility为Caller调用端,CalleeAbility为被调用端。此操作不会将CalleeAbility的页面切换到前台展示。 24 254.在输入框**输入待发送的消息**输入要传递给CalleeAbility的序列化数据,比如"play music"。 26 275.点击**通过Call调用发送消息**按钮,触发将步骤4中输入的字符串序列化后传递给Callee被调用端,在MainAbility的页面显示消息发送成功**send play music succeed**。与此同时,切换到CalleeAbility的页面,页面显示Caller发送的数据**play music**。 28 296.点击**释放Caller**按钮,释放Caller通信接口,Caller被释放后MainAbility无法发送数据给CalleeAbility。 30 31### 约束与限制 32 331.本示例仅支持标准系统上运行。 34 352.本示例为Stage模型,从API version 9开始支持。 36 373.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行,不支持预览。 38 394.本示例需要使用@ohos.distributedHardware.deviceManager系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md)。