未验证 提交 17f3006d 编写于 作者: O openharmony_ci 提交者: Gitee

!6418 【轻量级 PR】:update zh-cn/application-dev/device/sensor-guidelines.md.

Merge pull request !6418 from 陈伟/N/A
...@@ -34,40 +34,52 @@ ...@@ -34,40 +34,52 @@
1. 获取设备上传感器的数据,需要在“config.json”里面进行配置请求权限。具体如下: 1. 获取设备上传感器的数据,需要在“config.json”里面进行配置请求权限。具体如下:
``` ```
”reqPermissions“:[ "reqPermissions": [
{ {
"name":"ohos.permission.ACCELEROMETER", "name": "ohos.permission.ACCELEROMETER",
"reason"":"", "reason": "",
"usedScene":{ "usedScene": {
"ability": ["sensor.index.MainAbility",".MainAbility"], "ability": [
"when":"inuse" "sensor.index.MainAbility",
} ".MainAbility"
}, ],
{ "when": "inuse"
"name":"ohos.permission.GYROSCOPE", }
"reason"":"", },
"usedScene":{ {
"ability": ["sensor.index.MainAbility",".MainAbility"], "name": "ohos.permission.GYROSCOPE",
"when":"inuse" "reason": "",
} "usedScene": {
}, "ability": [
{ "sensor.index.MainAbility",
"name":"ohos.permission.ACTIVITY_MOTION", ".MainAbility"
"reason"":"ACTIVITY_MOTION_TEST", ],
"usedScene":{ "when": "inuse"
"ability": ["sensor.index.MainAbility",".MainAbility"], }
"when":"inuse" },
} {
}, "name": "ohos.permission.ACTIVITY_MOTION",
{ "reason": "ACTIVITY_MOTION_TEST",
"name":"ohos.permission.READ_HEALTH_DATA", "usedScene": {
"reason"":"HEALTH_DATA_TEST", "ability": [
"usedScene":{ "sensor.index.MainAbility",
"ability": ["sensor.index.MainAbility",".MainAbility"], ".MainAbility"
"when":"inuse" ],
} "when": "inuse"
}, }
] },
{
"name": "ohos.permission.READ_HEALTH_DATA",
"reason": "HEALTH_DATA_TEST",
"usedScene": {
"ability": [
"sensor.index.MainAbility",
".MainAbility"
],
"when": "inuse"
}
}
]
``` ```
2. 持续监听传感器数据变化。 2. 持续监听传感器数据变化。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册