代码拉取完成,页面将自动刷新
本示例主要展示IsolatedComponent的基本能力,通过该组件在受限worker上加载独立发布的卡片hap包,并实现了简单的卡片包管理的功能。 依赖了关键接口:
Index Page | IsolatedComponent Page |
---|---|
使用说明
entry/src/main/ets/
|---manager
| |---CardManager.ets // 卡片包管理模块
| |---CardMeta.ets // 卡片包元数据
|---pages
| |---Index.ets // 首页
| |---IsolatedComponentPage.ets // 卡片页面
|---workers
| |---Worker.ets // worker运行的入口文件
Index页面提供了注册卡片和拉起IsolatedComponent页面的入口,源码参考:Index.ts
IsolatedComponentPage页面提供了worker和IsolatedComponent创建及拉起的功能,源码参考:IsolatadComponentPage
对hap文件的管理功能封装在了CardManager模块中,提供了卡片hap包解压缩、校验ABC可执行文件、注册和管理元数据的功能,源码参考:CardManager.ets
Host应用依赖与本工程同级目录下的IsolatedCard工程作为动态加载的卡片工程来运行。
如需单独下载本工程,执行如下命令:
git init
git config core.sparsecheckout true
echo code/SuperFeature/IsolatedComponent/ > .git/info/sparse-checkout
git remote add origin https://gitee.com/openharmony/applications_app_samples.git
git pull origin master
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。