配置文件示例

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

{
    "app": {
        "bundleName": "com.huawei.hiworld.himusic",
        "vendor": "huawei",
        "version": {
            "code": 2, 
            "name": "2.0"
        },
        "apiVersion": {
            "compatible": 3, 
            "target": 3,
            "releaseType": "Beta1"
        }
    },
    "deviceConfig": {
        "default": {
        }
    },
    "module": {
        "mainAbility": "MainAbility",
        "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",
                "formsEnabled": 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",
                "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"
                }
            }
        ]
    }
}

results matching ""

    No results matching ""