| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 12-May-2024 | - | 38 | 35 | ||
| entry/ | 12-May-2024 | - | 1,441 | 1,219 | ||
| screenshots/device/ | 12-May-2024 | - | ||||
| .gitignore | D | 12-May-2024 | 121 | 8 | 8 | |
| README.md | D | 12-May-2024 | 1,011 | 23 | 13 | |
| README_zh.md | D | 12-May-2024 | 1.5 KiB | 41 | 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 | 304 | 16 | 15 |
README.md
1# ServiceExtAbility 2 3### Introduction 4 5This sample shows how to create and use a Service Extension ability in eTS. 6 7### Usage 81. After the demo app is started, touch **Start**. The ability startup status is displayed. 9 102. Enter two numbers, which will be passed to the Service Extension ability for the addition operation. 11 123. Touch **Connect** to connect to the Service Extension ability. The ability connection status is displayed. 13 143. After the ability is connected, the numbers entered are sent to the Service Extension ability, which calculates the result and returns the result to the demo app. The app's page displays the calculation result. 15 164. Touch **Disconnect** to disconnect from the Service Extension ability. The ability disconnection status is displayed. 17 18### Constraints 19 201. This sample can only be run on standard-system devices. 212. This sample is based on the stage model, which is supported from API version 9. 223. The DevEco Studio version used in this sample must be 3.0 Canary7 or later. 23
README_zh.md
1# ServiceExtAbility的创建与使用 2 3### 简介 4 5本示例展示了ServiceExtAbility的创建与使用。实现效果如下: 6 7  8 9### 相关概念 10 11FaultLogInfo:获取到的故障信息的数据结构。 12 13querySelfFaultLog:获取当前进程故障信息,该方法通过回调方式获取故障信息数组,故障信息数组内最多上报10份故障信息。 14 15### 相关权限 16 17不涉及。 18 19### 使用说明 20 211.启动应用后,点击**启动服务**,会显示服务启动状态。 22 232.输入两个数字,传入service做累加操作。 24 253.点击**连接服务**,会显示服务连接状态。 26 273.连接服务成功后,会将本地输入发送到Service中,Service对数据进行累加运算后返回给本地应用,并在本地应用界面显示运算结果。 28 294.点击**断开服务**,断开Service,显示服务断开状态。 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.application.ServiceExtensionAbility系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md)。 40 41