HarmonyOS应用基础知识( 三 )


文章插图
 
示例:
"shortcuts": [{"shortcutId": "id","label": "$string:shortcut","intents": [{"targetBundle": "com.huawei.hiworld.himusic","targetClass": "com.huawei.hiworld.himusic.entry.MainAbility"}]}]配置文件示例以JSON文件为config.json的一个简单示例,该示例的应用声明为三个Ability 。
{"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"}}]}}



推荐阅读