鴻蒙OS 創(chuàng)建車載應(yīng)用項(xiàng)目

2020-09-18 17:56 更新

說明

開始前,請(qǐng)參考 DevEco Studio快速開始 完成環(huán)境搭建、創(chuàng)建并運(yùn)行一個(gè)項(xiàng)目。

配置 config.json

  1. 添加訪問車機(jī)硬件信息權(quán)限申請(qǐng)。

  1. "reqPermissions": [
  2. {
  3. "name": "ohos.permission.vehicle.READ_VEHICLE_HMI_INFO",
  4. "reason": "",
  5. "usedScene": {
  6. "ability": [
  7. ".MainAbility"
  8. ],
  9. "when": "inuse"
  10. }
  11. }
  12. ]

  1. 添加支持駕駛模式標(biāo)簽。

  1. "abilities": {
  2. "name": ".carlink",
  3. "icon": "$carlink:icon",
  4. "label": "carlink",
  5. "supported-modes": ["drive"],
  6. }

說明

  1. 創(chuàng)建車機(jī)應(yīng)用需要添加支持駕駛模式標(biāo)簽 "supported-modes": ["drive"], // 駕駛模式支持
  2. 創(chuàng)建車輛控制應(yīng)用需要申請(qǐng)車機(jī)信號(hào)對(duì)應(yīng)的權(quán)限群組,例如讀取車輛燃油類型,需要申請(qǐng)群組 READ_VEHICLE_FUEL_INFO。
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)