鸿蒙OS 配置文件示例

2020-09-15 09:26 更新

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

  1. {
  2. "app": {
  3. "bundleName": "com.huawei.hiworld.himusic",
  4. "vendor": "huawei",
  5. "version": {
  6. "code": 2,
  7. "name": "2.0"
  8. }
  9. "apiVersion": {
  10. "compatible": 3,
  11. "target": 3
  12. }
  13. },
  14. "deviceConfig": {
  15. "default": {
  16. }
  17. },
  18. "module": {
  19. "package": "com.huawei.hiworld.himusic.entry",
  20. "name": ".MainApplication",
  21. "supportedModes": [
  22. "drive"
  23. ],
  24. "distro": {
  25. "moduleType": "entry",
  26. "deliveryWithInstall": true,
  27. "moduleName": "hap-car"
  28. },
  29. "deviceType": [
  30. "car"
  31. ],
  32. "abilities": [
  33. {
  34. "name": ".MainAbility",
  35. "description": "himusic main ability",
  36. "icon": "$media:ic_launcher",
  37. "label": "HiMusic",
  38. "launchType": "standard",
  39. "orientation": "unspecified",
  40. "visible": true,
  41. "skills": [
  42. {
  43. "actions": [
  44. "action.system.home"
  45. ],
  46. "entities": [
  47. "entity.system.home"
  48. ]
  49. }
  50. ],
  51. "type": "page",
  52. "formEnabled": false
  53. },
  54. {
  55. "name": ".PlayService",
  56. "description": "himusic play ability",
  57. "icon": "$media:ic_launcher",
  58. "label": "HiMusic",
  59. "launchType": "standard",
  60. "orientation": "unspecified",
  61. "visible": false,
  62. "skills": [
  63. {
  64. "actions": [
  65. "action.play.music",
  66. "action.stop.music"
  67. ],
  68. "entities": [
  69. "entity.audio"
  70. ]
  71. }
  72. ],
  73. "type": "service",
  74. "formEnabled": false,
  75. "backgroundModes": [
  76. "audioPlayback"
  77. ]
  78. },
  79. {
  80. "name": ".UserADataAbility",
  81. "type": "data",
  82. "uri": "dataability://com.huawei.hiworld.himusic.UserADataAbility",
  83. "visible": true
  84. }
  85. ],
  86. "reqPermissions": [{
  87. "name": "ohos.permission.DISTRIBUTED_DATASYNC",
  88. "reason": "",
  89. "usedScene": {
  90. "ability": [
  91. "com.huawei.hiworld.himusic.entry.MainAbility",
  92. "com.huawei.hiworld.himusic.entry.PlayService"
  93. ],
  94. "when": "inuse"
  95. }
  96. }
  97. ]
  98. }
  99. }
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号