1 Star 0 Fork 0

ren3016 / HarmonyOS_系统能力检测

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

HarmonyOS 系统能力检测 SystemCapability

介绍

系统能力 SystemCapability 检测

开发平台

Win11 + DevEco Stuido,本实例新建了自定义函数并引用

开发步骤

  1. 在 DevEco Studio 中 File->New_Create Project,选择 Application->Empty Ability, Next, Compile SDK:3.1.0(API 9), Model: stage

  2. 新建 ets\common\func.ets 并写入函数:

  3. 修改 entry\src\main\resources\base\element\string.json 文件中的 EntryAbility_label 的 value 为 系统能力。 同时修改和 base 同级的 zh_CN、en_US 下的 string.json 文件中的 EntryAbility_label 的 value 为 系统能力

  4. 使用 USB 链接手机 并打开手机 USB 调试

  5. 在 File 中选择 Project Structure -> Signing Configs 选择 Support HarmonyOS 和 Automatically generate signature (需要打开浏览器登录华为帐号并授权)

  6. 链接手机成功后, 点击右上角工具栏的真机调试。

  7. 手机上自动添加了名为 系统能力 的应用

主页代码

详见资源

string.json 配置文件修改

  1. entry\src\main\resources\base\element\string.json (默认配置文件)
  2. entry\src\main\resources\zh_CN\element\string.json (中文配置文件)
  3. entry\src\main\resources\en_US\element\string.json (英文配置文件)
{
  "string": [
    {
      "name": "module_desc",
      "value": "module description"
    },
    {
      "name": "EntryAbility_desc",
      "value": "系统能力 SystemCapability 检测"
    },
    {
      "name": "EntryAbility_label",
      "value": "系统能力"
    }
  ]
}

相关权限

克隆安装

git clone https://gitee.com/ren3016/harmonyos_http_request.git

使用说明

打开应用,可以看到获取远程JSON数据后解析出来的值。

约束与限制

  1. 本示例仅支持标准系统上运行,支持设备:华为手机或运行在DevEco Studio上的华为手机设备模拟器。
  2. 本示例为Stage模型,支持API Version 9。
  3. 本示例需要使用DevEco Studio 3.1 Release版本进行编译运行。

页面效果

输入图片说明

MIT License Copyright (c) 2023 ren3016 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

系统能力 SystemCapability 检测 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/ren3016/harmonyos_sys_capability.git
git@gitee.com:ren3016/harmonyos_sys_capability.git
ren3016
harmonyos_sys_capability
HarmonyOS_系统能力检测
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891