赞
踩
如图所示:
Stage 模型应用配置文件主要有两类:
AppScope
目录下,app.json5
。用来配置应用全局的信息。module.json5
。用来配置模块的信息。示例:
{
"app": {
"bundleName": "com.tyhoo.ohos.myapplication",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
bundleName
versionCode、versionName
icon
/AppScope/resources/base/media
目录下的图片。label
/AppScope/resources/base/element
目录下的 string.json。示例:
{ "module": { "requestPermissions": [ { "name": "ohos.permission.INTERNET" } ], "name": "entry", "type": "entry", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ "phone", "tablet" ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ts", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ] } ] } }
requestPermissions
name、type
description
/当前模块/src/main/resources/base/element
目录下的 string.json。mainElement
EntryAbility(入口 Ability)
,存放在 /当前模块/src/main/ets/entryability
目录下的 EntryAbility.ts。deviceTypes
deliveryWithInstall
pages
/当前模块/src/main/resources/base/profile
目录下的 main_pages.json。abilities
注:更详细的配置信息可以到 官方文档 - 应用配置文件概述(Stage模型)查看。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。