创新互联鸿蒙OS教程:鸿蒙OS配置文件示例

以 JSON 文件为 config.json 的一个简单示例,该示例的应用声明为三个 Ability。

创新互联-专业网站定制、快速模板网站建设、高性价比肥乡网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式肥乡网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖肥乡地区。费用合理售后完善,10余年实体公司更值得信赖。

{
    "app": {
        "bundleName": "com.huawei.hiworld.himusic",
        "vendor": "huawei",
        "version": {
            "code": 2, 
            "name": "2.0"
        }
        "apiVersion": {
            "compatible": 3, 
            "target": 3
        }
    },
    "deviceConfig": {
        "default": {
        }
    },
    "module": {
        "package": "com.huawei.hiworld.himusic.entry",
        "name": ".MainApplication",
        "supportedModes": [
            "drive"
        ],
        "distro": {
            "moduleType": "entry",
            "deliveryWithInstall": true,
            "moduleName": "hap-car"
        },
        "deviceType": [
            "car"
        ],

 
        "abilities": [
            {
                "name": ".MainAbility",
                "description": "himusic main ability",
                "icon": "$media:ic_launcher",
                "label": "HiMusic",
                "launchType": "standard",
                "orientation": "unspecified",
                "visible": true,
                "skills": [
                    {
                        "actions": [
                            "action.system.home"
                        ],
                        "entities": [
                            "entity.system.home"
                        ]
                    }
                ],
                "type": "page",
                "formEnabled": false
            },
            {
                "name": ".PlayService",
                "description": "himusic play ability",
                "icon": "$media:ic_launcher",
                "label": "HiMusic",
                "launchType": "standard",
                "orientation": "unspecified",
                "visible": false,
                "skills": [
                    {
                        "actions": [
                            "action.play.music",
                            "action.stop.music"
                        ],
                        "entities": [
                            "entity.audio"
                        ]
                    }
                ],
                "type": "service",
                "formEnabled": false,
                "backgroundModes": [
                    "audioPlayback"
                ]
            },
            {
                "name": ".UserADataAbility",
                "type": "data",
                "uri": "dataability://com.huawei.hiworld.himusic.UserADataAbility",
                "visible": true
            }
        ],
        "reqPermissions": [{
                "name": "ohos.permission.DISTRIBUTED_DATASYNC",
                "reason": "",
                "usedScene": {
                    "ability": [
                        "com.huawei.hiworld.himusic.entry.MainAbility",
                        "com.huawei.hiworld.himusic.entry.PlayService"
                    ],
                    "when": "inuse"
                }
            }
        ]
    }
}

本文标题:创新互联鸿蒙OS教程:鸿蒙OS配置文件示例
标题网址:http://www.mswzjz.cn/qtweb/news9/273009.html

攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能