• Home
Name Date Size #Lines LOC

..--

AppScope/22-Oct-2025-3734

entry/22-Oct-2025-2,0271,738

hvigor/22-Oct-2025-2019

screenshots/device/22-Oct-2025-

.gitignoreD22-Oct-202596 77

README.mdD22-Oct-20251.6 KiB3819

README_zh.mdD22-Oct-20253.7 KiB7755

build-profile.json5D22-Oct-20251.1 KiB4342

hvigorfile.jsD22-Oct-2025168 21

oh-package.json5D22-Oct-2025853 2726

ohosTest.mdD22-Oct-2025779 1410

README.md

1# Window Extension Ability
2
3### Introduction
4
5This sample simulates the **Setting** app, where you can touch the menu bar to go to the details page.
6
7In this sample, the [Window Extension Ability](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis-arkui/js-apis-application-windowExtensionAbility-sys.md) is used to set abilities, and [AbilityComponent](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis-arkui/arkui-ts/ts-container-ability-component-sys.md) is used to load abilities.
8
9### Usage
10
111. In portrait mode, touch the **Setting** menu bar on the left. The details page is displayed.
12
132. In landscape mode, touch the **Setting** menu bar on the left. The details page is displayed on the right.
14
15### Preview
16
17![](screenshots/device/en/index.png) ![](screenshots/device/en/wlan.png)
18![](screenshots/device/en/bluetooth.png) ![](screenshots/device/en/mobileData.png)
19
20### Required Permissions
21
22N/A
23
24### Dependency
25
26N/A
27
28### Constraints
29
301. This sample can only be run on standard-system devices that use the Rockchip RK3568 chip.
31
322. This sample demonstrates the stage model, which supports only the SDK of API version 9 (SDK version: 3.2.6.3 Beta2).
33
343. DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) must be used.
35
364. **WindowExtensionAbility** and **AbilityComponent** are system APIs and require the use of the Full SDK. To use the Full SDK, you must manually obtain it from the mirror and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](https://docs.openharmony.cn/pages/v3.2/en/application-dev/quick-start/full-sdk-switch-guide.md/).
37
38

README_zh.md

1# 窗口扩展应用(仅对系统应用开放)
2
3### 介绍
4
5本示例仿设置应用,实现点击设置菜单栏,跳转或加载详情页面。
6
7本示例通过 [UIExtensionAbility](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-uiExtensionAbility.md) 设置不同Ability,使用 [UIExtensionComponent](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-ui-extension-component-sys.md) 组件加载各个Ability。
8
9### 效果预览
10
11|主页| WLAN页面                              | 蓝牙页面                                     | 移动数据页面                                    |
12|--------------------------------|-------------------------------------|------------------------------------------|-------------------------------------------|
13|![](screenshots/device/zh/index.png) | ![](screenshots/device/zh/wlan.png) | ![](screenshots/device/zh/bluetooth.png) | ![](screenshots/device/zh/mobileData.png) |
14
15使用说明:
16
171.竖屏模式下点击左侧设置菜单栏,跳转详情页面。
18
192.横屏模式下(只支持带有重力感应设备)点击左侧设置菜单栏,右侧显示详情页面。
20
21### 工程目录
22```
23entry/src/main/ets/
24|---Application
25|   |---MyAbilityStage.ts
26|---feature
27|   |---Logger.ts                           // 日志工具
28|---MainAbility
29|   |---BluetoothExtAbility.ts
30|   |---MainAbility.ts
31|   |---MobileDataExtAbility.ts
32|   |---WlanExtAbility.ts
33|---mock
34|   |---InfoData.ts                         // 数据类型
35|---pages
36|   |---common
37|   |   |---Common.ets                      // 全局通用组件
38|   |---Index.ets                           // 首页
39|   |---Bluetooth.ets                       // 蓝牙
40|   |---MobileData.ets                      // 移动数据
41|   |---Wlan.ets                            // Wlan
42```
43### 具体实现
44
45* 本示例通过窗口扩展能力设置不同Ability,使用AbilityComponent组件加载各个Ability,matchMediaSync方法设置媒体查询的查询条件,RemoteObject方法实现远程对象。
46* 源码链接:[WlanExtAbility.ts](entry/src/main/ets/MainAbility/WlanExtAbility.ts),[BluetoothExtAbility.ts](entry/src/main/ets/MainAbility/BluetoothExtAbility.ts),[MobileDataExtAbility.ts](entry/src/main/ets/MainAbility/MobileDataExtAbility.ts)
47* 接口参考:[@ohos.app.ability.UIExtensionAbility](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/reference/apis-ability-kit/js-apis-app-ability-uiExtensionAbility.md),[UIExtensionComponent](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-arkui/arkui-ts/ts-container-ui-extension-component-sys.md)
48
49### 相关权限
50
51不涉及。
52
53### 依赖
54
55不涉及。
56
57### 约束与限制
58
591.本示例仅支持标准系统上运行,支持设备:支持RK3568。
60
612.本示例已适配API version 14版本SDK,版本号:5.0.2。
62
633.本示例需要使用DevEco Studio 5.0.2 Release (Build Version: 5.0.7.210, built on February 11, 2025)及以上版本才可编译运行。
64
654.本示例使用的UIExtensionAbility、UIExtensionComponent均为系统接口,需要使用Full SDK手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/faqs/full-sdk-switch-guide.md)66
67### 下载
68
69如需单独下载本工程,执行如下命令:
70```
71git init
72git config core.sparsecheckout true
73echo code/SystemFeature/WindowManageMent/WindowExtAbility/ > .git/info/sparse-checkout
74git remote add origin https://gitee.com/openharmony/applications_app_samples.git
75git pull origin master
76
77```