Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8bfe0ac4
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8bfe0ac4
编写于
7月 10, 2023
作者:
Z
zhongyuyan
提交者:
Gitee
7月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:openharmony/docs into master
Signed-off-by:
N
zhongyuyan
<
zhongyuyan1@huawei.com
>
上级
d9c78327
ab8dc3de
变更
38
展开全部
显示空白变更内容
内联
并排
Showing
38 changed file
with
3481 addition
and
2110 deletion
+3481
-2110
CODEOWNERS
CODEOWNERS
+6
-5
zh-cn/application-dev/application-models/hop-cross-device-migration.md
...tion-dev/application-models/hop-cross-device-migration.md
+66
-0
zh-cn/application-dev/application-models/inter-device-interaction-hop-overview.md
...plication-models/inter-device-interaction-hop-overview.md
+2
-2
zh-cn/application-dev/device/sensor-guidelines.md
zh-cn/application-dev/device/sensor-guidelines.md
+19
-16
zh-cn/application-dev/device/vibrator-guidelines.md
zh-cn/application-dev/device/vibrator-guidelines.md
+113
-122
zh-cn/application-dev/napi/Readme-CN.md
zh-cn/application-dev/napi/Readme-CN.md
+5
-1
zh-cn/application-dev/reference/apis/Readme-CN.md
zh-cn/application-dev/reference/apis/Readme-CN.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityConstant.md
...dev/reference/apis/js-apis-app-ability-abilityConstant.md
+21
-0
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md
...on-dev/reference/apis/js-apis-app-ability-wantConstant.md
+2
-0
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
+0
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
...erence/apis/js-apis-inner-application-uiAbilityContext.md
+76
-0
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-sensor.md
zh-cn/application-dev/reference/apis/js-apis-sensor.md
+1509
-1445
zh-cn/application-dev/reference/apis/js-apis-sim.md
zh-cn/application-dev/reference/apis/js-apis-sim.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-system-sensor.md
...n/application-dev/reference/apis/js-apis-system-sensor.md
+73
-72
zh-cn/application-dev/reference/apis/js-apis-system-vibrate.md
.../application-dev/reference/apis/js-apis-system-vibrate.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-util.md
zh-cn/application-dev/reference/apis/js-apis-util.md
+31
-17
zh-cn/application-dev/reference/apis/js-apis-vibrator.md
zh-cn/application-dev/reference/apis/js-apis-vibrator.md
+234
-226
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
...ication-dev/reference/arkui-ts/ts-basic-components-web.md
+38
-3
zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md
...ication-dev/reference/arkui-ts/ts-container-tabcontent.md
+1
-1
zh-cn/application-dev/reference/native-apis/Readme-CN.md
zh-cn/application-dev/reference/native-apis/Readme-CN.md
+9
-0
zh-cn/application-dev/reference/native-apis/_vk_external_format_o_h_o_s.md
...-dev/reference/native-apis/_vk_external_format_o_h_o_s.md
+26
-0
zh-cn/application-dev/reference/native-apis/_vk_import_native_buffer_info_o_h_o_s.md
...ence/native-apis/_vk_import_native_buffer_info_o_h_o_s.md
+26
-0
zh-cn/application-dev/reference/native-apis/_vk_memory_get_native_buffer_info_o_h_o_s.md
.../native-apis/_vk_memory_get_native_buffer_info_o_h_o_s.md
+26
-0
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_format_properties_o_h_o_s.md
...ative-apis/_vk_native_buffer_format_properties_o_h_o_s.md
+33
-0
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_properties_o_h_o_s.md
...rence/native-apis/_vk_native_buffer_properties_o_h_o_s.md
+27
-0
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_usage_o_h_o_s.md
.../reference/native-apis/_vk_native_buffer_usage_o_h_o_s.md
+26
-0
zh-cn/application-dev/reference/native-apis/_vk_surface_create_info_o_h_o_s.md
.../reference/native-apis/_vk_surface_create_info_o_h_o_s.md
+27
-0
zh-cn/application-dev/reference/native-apis/_vulkan.md
zh-cn/application-dev/reference/native-apis/_vulkan.md
+820
-0
zh-cn/application-dev/reference/native-apis/vulkan__ohos_8h.md
.../application-dev/reference/native-apis/vulkan__ohos_8h.md
+69
-0
zh-cn/application-dev/website.md
zh-cn/application-dev/website.md
+1
-1
zh-cn/device-dev/Readme-CN.md
zh-cn/device-dev/Readme-CN.md
+0
-1
zh-cn/device-dev/driver/driver-peripherals-audio-des.md
zh-cn/device-dev/driver/driver-peripherals-audio-des.md
+5
-5
zh-cn/device-dev/kernel/Readme-CN.md
zh-cn/device-dev/kernel/Readme-CN.md
+165
-166
zh-cn/device-dev/security/Readme-CN.md
zh-cn/device-dev/security/Readme-CN.md
+4
-4
zh-cn/device-dev/subsystems/Readme-CN.md
zh-cn/device-dev/subsystems/Readme-CN.md
+1
-2
zh-cn/device-dev/website.md
zh-cn/device-dev/website.md
+0
-1
zh-cn/release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md
...changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md
+12
-10
未找到文件。
CODEOWNERS
浏览文件 @
8bfe0ac4
...
...
@@ -224,8 +224,9 @@ zh-cn/application-dev/background-agent-scheduled-reminder/ @RayShih
zh-cn/application-dev/background-task-management/ @ningningW @wangwenli_wolf @tangtiantian2021 @nan-xiansen
zh-cn/application-dev/work-scheduler/ @ningningW
zh-cn/application-dev/internationalization/ @ningningW @Buda-Liu @mengjingzhimo @yangqing3
zh-cn/application-dev/device/usb-overview.md @ge-yafang @jasonyujia @andeszhang @liuhonggang123
zh-cn/application-dev/device/usb-guidelines.md @ge-yafang @jasonyujia @andeszhang @liuhonggang123
zh-cn/application-dev/device/usb-overview.md @ge-yafang @Kevin-Lau @liuhonggang123
zh-cn/application-dev/device/usb-guidelines.md @ge-yafang @Kevin-Lau @liuhonggang123
zh-cn/application-dev/napi/usb-ddk-guidelines.md @ge-yafang @Kevin-Lau @liuhonggang123
zh-cn/application-dev/device/device-location-overview.md @RayShih
zh-cn/application-dev/device/device-location-info.md @RayShih
zh-cn/application-dev/device/device-location-geocoding.md @RayShih
...
...
@@ -499,9 +500,9 @@ zh-cn/application-dev/reference/apis/js-apis-uitest.md @inter515 @ningningW @int
zh-cn/application-dev/reference/apis/js-apis-update.md @hughes802 @ningningW @zhangzhengxue @mamba-ting
zh-cn/application-dev/reference/apis/js-apis-uri.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-url.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-usbManager.md @
jasonyujia @ge-yafang @andeszhang
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-usb.md @
jasonyujia @ge-yafang @andeszhang
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-usb-deprecated.md @
jasonyujia @ge-yafang @andeszhang
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-usbManager.md @
ge-yafang @Kevin-Lau
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-usb.md @
ge-yafang @Kevin-Lau
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-usb-deprecated.md @
ge-yafang @Kevin-Lau
@liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md @gaoyong @zengyawen @niejiteng @jumozhanjiang
zh-cn/application-dev/reference/apis/js-apis-util.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-vector.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
...
...
zh-cn/application-dev/application-models/hop-cross-device-migration.md
浏览文件 @
8bfe0ac4
...
...
@@ -11,6 +11,12 @@
-
支持应用兼容性检测。
-
支持应用根据实际使用场景动态设置迁移状态(默认迁移状态为ACTIVE激活状态)。如编辑类应用在编辑文本的页面下才需要迁移,其他页面不需要迁移,则可以通过
[
setMissionContinueState
](
../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10
)
进行控制。
-
支持应用动态选择是否进行页面栈恢复(默认进行页面栈信息恢复)。如应用希望自定义迁移到其他设备后显示的页面,则可以通过
[
SUPPORT_CONTINUE_PAGE_STACK_KEY
](
../reference/apis/js-apis-app-ability-wantConstant.md#wantconstantparams
)
进行控制。
-
支持应用动态选择流转成功后是否退出迁移发起端应用(默认流转成功后退出迁移发起端应用)。则可以通过
[
SUPPORT_CONTINUE_SOURCE_EXIT_KEY
](
../reference/apis/js-apis-app-ability-wantConstant.md#wantconstantparams
)
进行控制。
## 跨端迁移流程
...
...
@@ -125,3 +131,63 @@
}
```
-
如果是单实例应用,则采用同样的代码实现onNewWant()接口即可。
6.
**可选配置:**
在应用支持迁移特性时,默认开启应用迁移状态开关,根据应用当前任务获取焦点/失去焦点通知周边的可信设备当前任务可流转/取消流转。若应用需要在特定场景下才通知周边设备可流转,则需要在应用打开时设置迁移状态为INACTIVE,在后续的业务流程中需要迁移时再设置迁移状态为ACTIVE。接口见
[
setMissionContinueState
](
../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10
)
。
- 示例:应用启动不需要流转
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
onCreate(want, launchParam) {
this.context.setMissionContinueState(AbilityConstant.ContinueState.INACTIVE, (result) => {
console.info(`setMissionContinueState: ${JSON.stringify(result)}`);
});
}
```
- 示例:应用在后续的业务流程中需要流转了
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
this.context.setMissionContinueState(AbilityConstant.ContinueState.ACTIVE, (result) => {
console.info(`setMissionContinueState: ${JSON.stringify(result)}`);
});
```
7.
**可选配置:**
支持应用动态选择是否进行页面栈恢复(默认进行页面栈信息恢复)。如果应用不想使用系统默认恢复的页面栈,则可以设置不进行页面栈迁移,而需要在
`onWindowStageRestore`
设置流转后进入的页面,参数定义见
[
SUPPORT_CONTINUE_PAGE_STACK_KEY
](
../reference/apis/js-apis-app-ability-wantConstant.md#wantconstantparams
)
。
- 示例:应用迁移不需要自动流转页面栈信息
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
import wantConstant from '@ohos.app.ability.wantConstant.d.ts';
onContinue(wantParam : {[key: string]: any}) {
console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`)
wantParam[wantConstant.SUPPORT_CONTINUE_PAGE_STACK_KEY] = false;
return AbilityConstant.OnContinueResult.AGREE;
}
onWindowStageRestore(windowStage) {
// 若不需要自动流转页面栈信息,则需要在此处设置应用流转后进入的页面
windowStage.setUIContent(this.contex, "pages/index", null);
}
```
8.
**可选配置:**
支持应用动态选择迁移成功后是否退出迁移发起端应用(默认流转成功后退出迁移发起端应用)。如果应用不想让系统自动退出迁移发起端应用,则可以设置不退出,参数定义见参数定义见
[
SUPPORT_CONTINUE_SOURCE_EXIT_KEY
](
../reference/apis/js-apis-app-ability-wantConstant.md#wantconstantparams
)
。
- 示例:应用迁移设置不需要迁移成功后退出迁移发起端应用
```ts
import UIAbility from '@ohos.app.ability.UIAbility';
import wantConstant from '@ohos.app.ability.wantConstant.d.ts';
onContinue(wantParam : {[key: string]: any}) {
console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`)
wantParam[wantConstant.SUPPORT_CONTINUE_SOURCE_EXIT_KEY] = false;
return AbilityConstant.OnContinueResult.AGREE;
}
```
\ No newline at end of file
zh-cn/application-dev/application-models/inter-device-interaction-hop-overview.md
浏览文件 @
8bfe0ac4
...
...
@@ -16,11 +16,11 @@
-
**跨端迁移**
在用户使用设备的过程中,当使用情境发生变化时(例如从室内走到户外或者周围有更合适的设备等),之前使用的设备可能已经不适合继续当前的任务,此时,用户可以选择新的设备来继续当前的任务,原设备
退出任务,这就是跨端迁移场景。常见的跨端迁移场景实例:在平板上播放的视频,迁移到智慧屏继续播放,从而获得更佳的观看体验;平板上的视频应用退出。在应用开发层面,跨端迁移指在A端运行的UIAbility迁移到B端上,完成迁移后, B端UIAbility继续任务,而A端UIAbility
退出。
在用户使用设备的过程中,当使用情境发生变化时(例如从室内走到户外或者周围有更合适的设备等),之前使用的设备可能已经不适合继续当前的任务,此时,用户可以选择新的设备来继续当前的任务,原设备
可按需决定是否退出任务,这就是跨端迁移场景。常见的跨端迁移场景实例:在平板上播放的视频,迁移到智慧屏继续播放,从而获得更佳的观看体验;平板上的视频应用退出。在应用开发层面,跨端迁移指在A端运行的UIAbility迁移到B端上,完成迁移后, B端UIAbility继续任务,而A端UIAbility可按需决定是否
退出。
-
**多端协同**
用户拥有的多个设备,可以作为一个整体,为用户提供比单设备更加高效、沉浸的体验,这就是多端协同场景。常见的多端协同场景实例:
平板侧应用A做答题板,智慧屏侧应用B做直播,为用户提供更优的上网课体验
。在应用开发层面,多端协同指多端上的不同UIAbility/ServiceExtensionAbility同时运行、或者交替运行实现完整的业务;或者多端上的相同UIAbility/ServiceExtensionAbility同时运行实现完整的业务。
用户拥有的多个设备,可以作为一个整体,为用户提供比单设备更加高效、沉浸的体验,这就是多端协同场景。常见的多端协同场景实例:
场景一:两台设备A和B打开备忘录同一篇笔记进行双端协同编辑,在设备A上可以使用本地图库中的图片资源插入编辑,设备B上进行文字内容编辑。场景二:设备A上正在和客户进行聊天,客户需要的资料在设备B上,可以通过聊天软件打开设备B上的文档应用选择到想要的资料回传到设备A上,然后通过聊天软件发送给客户
。在应用开发层面,多端协同指多端上的不同UIAbility/ServiceExtensionAbility同时运行、或者交替运行实现完整的业务;或者多端上的相同UIAbility/ServiceExtensionAbility同时运行实现完整的业务。
## 流转架构
...
...
zh-cn/application-dev/device/sensor-guidelines.md
浏览文件 @
8bfe0ac4
...
...
@@ -33,10 +33,11 @@
2.
以下场景以加速度传感器ACCELEROMETER为例。展示持续监听传感器接口的调用结果。
```
j
s
```
t
s
import
sensor
from
"
@ohos.sensor
"
;
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
function
(
data
){
console
.
info
(
"
Data obtained successfully. x:
"
+
data
.
x
+
"
y:
"
+
data
.
y
+
"
z:
"
+
data
.
z
);
// 获取数据成功
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
function
(
data
)
{
console
.
info
(
"
Succeeded in obtaining data. x:
"
+
data
.
x
+
"
y:
"
+
data
.
y
+
"
z:
"
+
data
.
z
);
// 获取数据成功
});
```
...
...
@@ -44,7 +45,7 @@
3.
注销传感器数据监听。
```
j
s
```
t
s
import
sensor
from
"
@ohos.sensor
"
;
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
);
```
...
...
@@ -53,10 +54,11 @@
4.
获取一次传感器数据变化。
```
j
s
```
t
s
import
sensor
from
"
@ohos.sensor
"
;
sensor
.
once
(
sensor
.
SensorId
.
ACCELEROMETER
,
function
(
data
)
{
console
.
info
(
"
Data obtained successfully. x:
"
+
data
.
x
+
"
y:
"
+
data
.
y
+
"
z:
"
+
data
.
z
);
// 获取数据成功
sensor
.
once
(
sensor
.
SensorId
.
ACCELEROMETER
,
function
(
data
)
{
console
.
info
(
"
Succeeded in obtaining data. x:
"
+
data
.
x
+
"
y:
"
+
data
.
y
+
"
z:
"
+
data
.
z
);
// 获取数据成功
});
```
...
...
@@ -64,13 +66,14 @@
若接口调用不成功,建议使用try/catch语句捕获代码中可能出现的错误信息。例如:
```
j
s
```
t
s
import sensor from "@ohos.sensor";
try {
sensor.once(sensor.SensorId.ACCELEROMETER, function
(data) {
console.info("Data obtained successfully
. x: " + data.x + "y: " + data.y + "z: " + data.z); // 获取数据成功
sensor.once(sensor.SensorId.ACCELEROMETER, function
(data) {
console.info("Succeeded in obtaining data
. x: " + data.x + "y: " + data.y + "z: " + data.z); // 获取数据成功
});
} catch (error) {
console.error("Get sensor data error. data:" + error.data, " msg:", error.message
);
console.error(
`Failed to get sensor data. Code: ${error.code}, message: ${error.message}`
);
}
```
zh-cn/application-dev/device/vibrator-guidelines.md
浏览文件 @
8bfe0ac4
...
...
@@ -110,8 +110,9 @@ Json文件共包含2个属性。
2.
根据指定振动效果和振动属性触发马达振动。
```
j
s
```
t
s
import
vibrator
from
'
@ohos.vibrator
'
;
try
{
vibrator
.
startVibration
({
// 使用startVibration需要添加ohos.permission.VIBRATE权限
type
:
'
time
'
,
...
...
@@ -121,37 +122,38 @@ try {
usage
:
'
alarm
'
},
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
'
vibrate fail, error.code:
'
+
error
.
code
+
'
error.message:
'
,
+
error
.
message
);
console
.
error
(
`Failed to start vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned to indicate a successful
vibration.
'
);
console
.
info
(
'
Succeed in starting
vibration.
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
errCode:
'
+
err
.
code
+
'
,msg:
'
+
err
.
message
);
console
.
error
(
`An unexpected error occurred. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
```
3.
按照指定模式停止马达的振动。
```
j
s
```
t
s
import
vibrator
from
'
@ohos.vibrator
'
;
try
{
// 按照VIBRATOR_STOP_MODE_TIME模式停止振动, 使用stopVibration需要添加ohos.permission.VIBRATE权限
vibrator
.
stopVibration
(
vibrator
.
VibratorStopMode
.
VIBRATOR_STOP_MODE_TIME
,
function
(
error
)
{
if
(
error
)
{
console
.
log
(
'
error.code
'
+
error
.
code
+
'
error.message
'
+
error
.
message
);
console
.
error
(
`Failed to stop vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned to indicate successful
.
'
);
console
.
info
(
'
Succeeded in stopping vibration
.
'
);
})
}
catch
(
err
)
{
console
.
info
(
'
errCode:
'
+
err
.
code
+
'
,msg:
'
+
err
.
message
);
console
.
error
(
`An unexpected error occurred. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
```
4.
停止所有模式的马达振动。
```
j
s
```
t
s
import
vibrator
from
'
@ohos.vibrator
'
;
// 使用startVibration、stopVibration需要添加ohos.permission.VIBRATE权限
try
{
...
...
@@ -163,36 +165,37 @@ try {
usage
:
'
alarm
'
},
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
'
vibrate fail, error.code:
'
+
error
.
code
+
'
error.message:
'
,
+
error
.
message
);
console
.
error
(
`Failed to start vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned to indicate a successful vibration.
'
);
console
.
info
(
'
Succeed in starting vibration
'
);
});
// 停止所有类型的马达振动
vibrator
.
stopVibration
(
function
(
error
)
{
if
(
error
)
{
console
.
log
(
'
error.code
'
+
error
.
code
+
'
error.message
'
+
error
.
message
);
console
.
error
(
`Failed to stop vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned to indicate successful.
'
);
console
.
info
(
'
Succeed in stopping vibration
'
);
})
}
catch
(
error
)
{
console
.
info
(
'
errCode:
'
+
error
.
code
+
'
,msg:
'
+
error
.
message
);
console
.
error
(
`An unexpected error occurred. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
}
```
5.
查询是否支持传入的参数effectId。
```
j
s
```
t
s
import
vibrator
from
'
@ohos.vibrator
'
;
try
{
// 查询是否支持'haptic.clock.timer'
vibrator
.
isSupportEffect
(
'
haptic.clock.timer
'
,
function
(
err
,
state
)
{
if
(
err
)
{
console
.
error
(
'
isSupportEffect failed, error:
'
+
JSON
.
stringify
(
err
)
);
console
.
error
(
`Failed to query effect. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
}
console
.
log
(
'
The effectId is
'
+
(
state
?
'
supported
'
:
'
unsupported
'
)
);
console
.
info
(
'
Succeed in querying effect
'
);
if
(
state
)
{
try
{
vibrator
.
startVibration
({
// 使用startVibration需要添加ohos.permission.VIBRATE权限
...
...
@@ -202,79 +205,67 @@ try {
},
{
usage
:
'
unknown
'
},
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
'
haptic.clock.timer vibrator error:
'
+
JSON
.
stringify
(
error
)
);
if
(
error
)
{
console
.
error
(
`Failed to start vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
}
else
{
console
.
log
(
'
haptic.clock.timer vibrator success
'
);
console
.
info
(
'
Succeed in starting vibration
'
);
}
});
}
catch
(
error
)
{
console
.
error
(
'
Exception in, error:
'
+
JSON
.
stringify
(
error
)
);
console
.
error
(
`An unexpected error occurred. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
}
}
})
}
catch
(
error
)
{
console
.
error
(
'
Exception in, error:
'
+
JSON
.
stringify
(
error
)
);
console
.
error
(
`An unexpected error occurred. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
}
```
6.
启动和停止自定义振动
```
j
s
```
t
s
import
vibrator
from
'
@ohos.vibrator
'
;
import
resourceManager
from
'
@ohos.resourceManager
'
;
const
FILE_NAME
=
"
xxx.json
"
;
async
function
openResource
(
fileName
)
{
let
fileDescriptor
=
undefined
;
let
mgr
=
await
resourceManager
.
getResourceManager
();
await
mgr
.
getRawFd
(
fileName
).
then
(
value
=>
{
fileDescriptor
=
{
fd
:
value
.
fd
,
offset
:
value
.
offset
,
length
:
value
.
length
};
console
.
log
(
'
openResource success fileName:
'
+
fileName
);
}).
catch
(
error
=>
{
console
.
log
(
'
openResource err:
'
+
error
);
});
return
fileDescriptor
;
}
async
function
closeResource
(
fileName
)
{
let
mgr
=
await
resourceManager
.
getResourceManager
();
await
mgr
.
closeRawFd
(
fileName
).
then
(()
=>
{
console
.
log
(
'
closeResource success fileName:
'
+
fileName
);
}).
catch
(
error
=>
{
console
.
log
(
'
closeResource err:
'
+
error
);
});
}
// 获取振动文件资源描述符
let
rawFd
=
openResource
(
FILE_NAME
);
let
fileDescriptor
=
undefined
;
getContext
().
resourceManager
.
getRawFd
(
FILE_NAME
).
then
(
value
=>
{
fileDescriptor
=
{
fd
:
value
.
fd
,
offset
:
value
.
offset
,
length
:
value
.
length
};
console
.
info
(
'
Succeed in getting resource file descriptor
'
);
}).
catch
(
error
=>
{
console
.
error
(
`Failed to get resource file descriptor. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
});
// 使用startVibration、stopVibration需要添加ohos.permission.VIBRATE权限
try
{
// 启动自定义振动
vibrator
.
startVibration
({
type
:
"
file
"
,
hapticFd
:
{
fd
:
rawFd
.
fd
,
offset
:
rawFd
.
offset
,
length
:
rawFd
.
length
}
hapticFd
:
{
fd
:
fileDescriptor
.
fd
,
offset
:
fileDescriptor
.
offset
,
length
:
fileDescriptor
.
length
}
},
{
usage
:
"
alarm
"
}).
then
(()
=>
{
console
.
info
(
'
startVibration success
'
);
console
.
info
(
'
Succeed in starting vibration
'
);
},
(
error
)
=>
{
console
.
info
(
'
startVibration error
'
);
console
.
error
(
`Failed to start vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
});
// 停止所有类型的马达振动
vibrator
.
stopVibration
(
function
(
error
)
{
if
(
error
)
{
console
.
log
(
'
error.code
'
+
error
.
code
+
'
error.message
'
+
error
.
message
);
console
.
error
(
`Failed to stop vibration. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned to indicate successful.
'
);
console
.
info
(
'
Succeed in stopping vibration
'
);
})
}
catch
(
error
)
{
console
.
info
(
'
errCode:
'
+
error
.
code
+
'
,msg:
'
+
error
.
message
);
console
.
error
(
`An unexpected error occurred. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
}
// 关闭振动文件资源
closeResource
(
FILE_NAME
);
getContext
().
resourceManager
.
closeRawFd
(
FILE_NAME
).
then
(()
=>
{
console
.
info
(
'
Succeed in closing resource file descriptor
'
);
}).
catch
(
error
=>
{
console
.
error
(
`Failed to close resource file descriptor. Code:
${
error
.
code
}
, message:
${
error
.
message
}
`
);
});
```
...
...
zh-cn/application-dev/napi/Readme-CN.md
浏览文件 @
8bfe0ac4
...
...
@@ -3,9 +3,13 @@
-
[
Native API在应用工程中的使用指导
](
napi-guidelines.md
)
-
[
Drawing开发指导
](
drawing-guidelines.md
)
-
[
Rawfile开发指导
](
rawfile-guidelines.md
)
-
[
NativeBuffer开发指导
](
native-buffer-guidelines.md
)
-
[
NativeImage开发指导
](
native-image-guidelines.md
)
-
[
NativeVsync开发指导
](
native-vsync-guidelines.md
)
-
[
NativeWindow开发指导
](
native-window-guidelines.md
)
-
[
使用MindSpore Lite引擎进行模型推理
](
mindspore-lite-guidelines.md
)
-
[
使用MindSpore Lite进行离线模型的转换及推理
](
mindspore-lite-offline-model-guidelines.md
)
-
[
Neural Network Runtime对接AI推理框架开发指导
](
neural-network-runtime-guidelines.md
)
-
[
Purgeable memory开发指导
](
purgeable-memory-guidelines.md
)
-
[
XComponent开发指导
](
xcomponent-guidelines.md
)
-
[
USB DDK开发指导
](
usb-ddk-guidelines.md
)
\ No newline at end of file
zh-cn/application-dev/reference/apis/Readme-CN.md
浏览文件 @
8bfe0ac4
...
...
@@ -418,7 +418,7 @@
-
[
@ohos.enterprise.dateTimeManager (系统时间管理)
](
js-apis-enterprise-dateTimeManager.md
)
-
[
@ohos.enterprise.deviceControl (设备控制管理)
](
js-apis-enterprise-deviceControl.md
)
-
[
@ohos.enterprise.deviceInfo (设备信息管理)
](
js-apis-enterprise-deviceInfo.md
)
-
[
@ohos.enterprise.deviceSettings (设备设置管理)
](
js-apis-enterprise-deviceSetings.md
)
-
[
@ohos.enterprise.deviceSettings (设备设置管理)
](
js-apis-enterprise-deviceSet
t
ings.md
)
-
[
@ohos.enterprise.EnterpriseAdminExtensionAbility (企业设备管理扩展能力)
](
js-apis-EnterpriseAdminExtensionAbility.md
)
-
[
@ohos.enterprise.networkManager (网络管理)
](
js-apis-enterprise-networkManager.md
)
-
[
@ohos.enterprise.wifiManager (WiFi管理)
](
js-apis-enterprise-wifiManager.md
)
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityConstant.md
浏览文件 @
8bfe0ac4
...
...
@@ -224,3 +224,24 @@ class MyAbility extends UIAbility {
}
}
```
## AbilityConstant.ContinueState<sup>10+</sup>
ContinueState说明枚举值。用于表示当前应用任务流转的状态。可配合
[
UIAbilityContext
](
js-apis-inner-application-uiAbilityContext.md
)
的
[
setMissionContinueState
](
js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10
)
方法进行设置。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 值 | 说明 |
| ------------- | --------- | ------------------------------------------------------------ |
| ACTIVE | 0 | 指示当前应用任务流转处于激活状态。 |
| INACTIVE | 1 | 指示当前应用任务流转处于未激活状态。 |
**示例:**
```
ts
import
AbilityConstant
from
'
@ohos.app.ability.AbilityConstant
'
;
this
.
context
.
setMissionContinueState
(
AbilityConstant
.
ContinueState
.
INACTIVE
,
(
result
)
=>
{
console
.
info
(
`setMissionContinueState:
${
JSON
.
stringify
(
result
)}
`
);
});
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md
浏览文件 @
8bfe0ac4
...
...
@@ -30,6 +30,8 @@ want的Params操作的常量。
| CONTENT_TITLE_KEY
<sup>
10+
</sup>
| ohos.extra.param.key.contentTitle | 指示原子化服务支持分享标题的参数的操作。 |
| SHARE_ABSTRACT_KEY
<sup>
10+
</sup>
| ohos.extra.param.key.shareAbstract | 指示原子化服务支持分享内容的参数的操作。 |
| SHARE_URL_KEY
<sup>
10+
</sup>
| ohos.extra.param.key.shareUrl | 指示原子化服务支持分享链接的参数的操作。 |
| SUPPORT_CONTINUE_PAGE_STACK_KEY
<sup>
10+
</sup>
| ohos.extra.param.key.supportContinuePageStack | 指示在跨端迁移过程中是否迁移页面栈信息,默认值为true,自动迁移页面栈信息。|
| SUPPORT_CONTINUE_SOURCE_EXIT_KEY
<sup>
10+
</sup>
| ohos.extra.param.key.supportContinueSourceExit | 指示跨端迁移源端应用是否退出,默认值为true,源端应用自动退出。|
## wantConstant.Flags
...
...
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
8bfe0ac4
...
...
@@ -8,8 +8,6 @@
> - 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> - 从API Version 9开始,该接口不再维护,推荐使用新接口[`@ohos.data.preferences`](js-apis-data-preferences.md)。
>
> - 本模块接口仅可在FA模型下使用。
## 导入模块
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
浏览文件 @
8bfe0ac4
...
...
@@ -2213,6 +2213,82 @@ setMissionIcon(icon: image.PixelMap): Promise\<void>;
console
.
error
(
`setMissionLabel failed, code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
```
## UIAbilityContext.setMissionContinueState<sup>10+</sup>
setMissionContinueState(state: AbilityConstant.ContinueState, callback:AsyncCallback
<
void
>
): void;
设置UIAbility任务中流转状态(callback形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| state |
[
ContinueState
](
js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10
)
| 是 | 流转状态。 |
| callback | AsyncCallback
<
void
>
| 是 | 回调函数,返回接口调用是否成功的结果。 |
**错误码:**
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
**示例:**
```
ts
import
AbilityConstant
from
'
@ohos.app.ability.AbilityConstant
'
;
this
.
context
.
setMissionContinueState
(
AbilityConstant
.
ContinueState
.
INACTIVE
,
(
result
)
=>
{
console
.
info
(
`setMissionContinueState:
${
JSON
.
stringify
(
result
)}
`
);
});
```
## UIAbilityContext.setMissionContinueState<sup>10+</sup>
setMissionContinueState(state: AbilityConstant.ContinueState): Promise
<
void
>
;
设置UIAbility任务中流转状态(promise形式)。
**系统能力**
:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| state |
[
ContinueState
](
js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10
)
| 是 | 流转状态。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise
<
void
>
| 返回一个Promise,包含接口的结果。 |
**错误码:**
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
错误码详细介绍请参考
[
errcode-ability
](
../errorcodes/errorcode-ability.md
)
**示例:**
```
ts
import
AbilityConstant
from
'
@ohos.app.ability.AbilityConstant
'
;
this
.
context
.
setMissionContinueState
(
AbilityConstant
.
ContinueState
.
INACTIVE
).
then
(()
=>
{
console
.
info
(
'
success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
`setMissionContinueState failed, code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
```
## UIAbilityContext.restoreWindowStage
restoreWindowStage(localStorage: LocalStorage) : void;
...
...
zh-cn/application-dev/reference/apis/js-apis-pasteboard.md
浏览文件 @
8bfe0ac4
...
...
@@ -1300,7 +1300,7 @@ setData(data: PasteData, callback: AsyncCallback<void>): void
**示例:**
```
js
let
pasteData
=
pasteboard
.
create
PlainTextData
(
'
content
'
);
let
pasteData
=
pasteboard
.
create
Data
(
pasteboard
.
MIMETYPE_TEXT_PLAIN
,
'
content
'
);
let
systemPasteboard
=
pasteboard
.
getSystemPasteboard
();
systemPasteboard
.
setData
(
pasteData
,
(
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -1343,7 +1343,7 @@ setData(data: PasteData): Promise<void>
**示例:**
```
js
let
pasteData
=
pasteboard
.
create
PlainTextData
(
'
content
'
);
let
pasteData
=
pasteboard
.
create
Data
(
pasteboard
.
MIMETYPE_TEXT_PLAIN
,
'
content
'
);
let
systemPasteboard
=
pasteboard
.
getSystemPasteboard
();
systemPasteboard
.
setData
(
pasteData
).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in setting PasteData.
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-sensor.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-sim.md
浏览文件 @
8bfe0ac4
...
...
@@ -615,7 +615,7 @@ hasSimCard\(slotId: number, callback: AsyncCallback\<boolean\>\): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------- | ---- | -------------------------------------- |
| slotId | number | 是 | 卡槽ID。
<br/>
- 0:卡槽1
<br/>
- 1:卡槽2 |
| callback | AsyncCallback
<
boolean
>
| 是
| 回调函数。
|
| callback | AsyncCallback
<
boolean
>
| 是
| 回调返回指定卡槽是否插卡,如果插卡返回true。
|
**错误码:**
...
...
zh-cn/application-dev/reference/apis/js-apis-system-sensor.md
浏览文件 @
8bfe0ac4
...
...
@@ -37,16 +37,16 @@ import sensor from '@system.sensor';
**示例:**
```
j
s
```
t
s
sensor
.
subscribeAccelerometer
({
interval
:
'
normal
'
,
success
:
function
(
ret
)
{
console
.
log
(
'
X-axis data:
'
+
ret
.
x
);
console
.
log
(
'
Y-axis data:
'
+
ret
.
y
);
console
.
log
(
'
Z-axis data:
'
+
ret
.
z
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
X-axis data:
'
+
ret
.
x
);
console
.
info
(
'
Succeeded in subscribing.
Y-axis data:
'
+
ret
.
y
);
console
.
info
(
'
Succeeded in subscribing.
Z-axis data:
'
+
ret
.
z
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -66,7 +66,7 @@ unsubscribeAccelerometer(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeAccelerometer
();
```
...
...
@@ -86,13 +86,13 @@ sensor.unsubscribeAccelerometer();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeCompass
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get data direction:
'
+
ret
.
direction
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get data direction:
'
+
ret
.
direction
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -110,7 +110,7 @@ unsubscribeCompass(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeCompass
();
```
...
...
@@ -130,13 +130,14 @@ sensor.unsubscribeCompass();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeProximity
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get data distance:
'
+
ret
.
distance
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get data distance:
'
+
ret
.
distance
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -154,7 +155,7 @@ unsubscribeProximity(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeProximity
();
```
...
...
@@ -174,13 +175,13 @@ sensor.unsubscribeProximity();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeLight
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get data intensity:
'
+
ret
.
intensity
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get data intensity:
'
+
ret
.
intensity
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -198,7 +199,7 @@ unsubscribeLight(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeLight
();
```
...
...
@@ -220,13 +221,13 @@ sensor.unsubscribeLight();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeStepCounter
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get step value:
'
+
ret
.
steps
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get step value:
'
+
ret
.
steps
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -246,7 +247,7 @@ unsubscribeStepCounter(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeStepCounter
();
```
...
...
@@ -267,13 +268,13 @@ subscribeBarometer(options: SubscribeBarometerOptions): void
**示例:**
```
j
s
```
t
s
sensor
.
subscribeBarometer
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get data value:
'
+
ret
.
pressure
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get data value:
'
+
ret
.
pressure
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -292,7 +293,7 @@ unsubscribeBarometer(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeBarometer
();
```
...
...
@@ -315,13 +316,13 @@ sensor.unsubscribeBarometer();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeHeartRate
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get heartrate value:
'
+
ret
.
heartRate
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get heartrate value:
'
+
ret
.
heartRate
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -342,7 +343,7 @@ unsubscribeHeartRate(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeHeartRate
();
```
...
...
@@ -362,13 +363,13 @@ sensor.unsubscribeHeartRate();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeOnBodyState
({
success
:
function
(
ret
)
{
console
.
log
(
'
Get on-body state value:
'
+
ret
.
value
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Get on-body state value:
'
+
ret
.
value
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -386,7 +387,7 @@ unsubscribeOnBodyState(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeOnBodyState
();
```
...
...
@@ -406,13 +407,13 @@ sensor.unsubscribeOnBodyState();
**示例:**
```
j
s
```
t
s
sensor
.
getOnBodyState
({
success
:
function
(
ret
)
{
console
.
log
(
'
On body state:
'
+
ret
.
value
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
On body state:
'
+
ret
.
value
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
},
});
```
...
...
@@ -435,16 +436,16 @@ sensor.getOnBodyState({
**示例:**
```
j
s
```
t
s
sensor
.
subscribeDeviceOrientation
({
interval
:
'
normal
'
,
success
:
function
(
ret
)
{
console
.
log
(
'
Alpha data:
'
+
ret
.
alpha
);
console
.
log
(
'
Beta data:
'
+
ret
.
beta
);
console
.
log
(
'
Gamma data:
'
+
ret
.
gamma
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
Alpha data:
'
+
ret
.
alpha
);
console
.
info
(
'
Succeeded in subscribing.
Beta data:
'
+
ret
.
beta
);
console
.
info
(
'
Succeeded in subscribing.
Gamma data:
'
+
ret
.
gamma
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; Data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
}
});
```
...
...
@@ -462,7 +463,7 @@ unsubscribeDeviceOrientation(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeDeviceOrientation
();
```
...
...
@@ -486,16 +487,16 @@ sensor.unsubscribeDeviceOrientation();
**示例:**
```
j
s
```
t
s
sensor
.
subscribeGyroscope
({
interval
:
'
normal
'
,
success
:
function
(
ret
)
{
console
.
log
(
'
X-axis data:
'
+
ret
.
x
);
console
.
log
(
'
Y-axis data:
'
+
ret
.
y
);
console
.
log
(
'
Z-axis data:
'
+
ret
.
z
);
success
:
function
(
ret
)
{
console
.
info
(
'
Succeeded in subscribing.
X-axis data:
'
+
ret
.
x
);
console
.
info
(
'
Succeeded in subscribing.
Y-axis data:
'
+
ret
.
y
);
console
.
info
(
'
Succeeded in subscribing.
Z-axis data:
'
+
ret
.
z
);
},
fail
:
function
(
data
,
code
)
{
console
.
error
(
'
Subscription failed. Code:
'
+
code
+
'
; data:
'
+
data
);
fail
:
function
(
data
,
code
)
{
console
.
error
(
`Failed to subscription. Code:
${
code
}
, data:
${
data
}
`
);
}
});
```
...
...
@@ -515,7 +516,7 @@ unsubscribeGyroscope(): void
**示例:**
```
j
s
```
t
s
sensor
.
unsubscribeGyroscope
();
```
...
...
zh-cn/application-dev/reference/apis/js-apis-system-vibrate.md
浏览文件 @
8bfe0ac4
...
...
@@ -36,17 +36,17 @@ import vibrator from '@system.vibrator';
**示例:**
```
j
s
```
t
s
vibrator
.
vibrate
({
mode
:
'
short
'
,
success
:
function
()
{
console
.
log
(
'
vibrate is successful
'
);
console
.
info
(
'
Succeed in vibrating
'
);
},
fail
:
function
(
data
,
code
)
{
console
.
log
(
"
vibrate is failed, data:
"
+
data
+
"
, code:
"
+
code
);
console
.
info
(
`Failed to vibrate. Data:
${
data
}
, code:
${
code
}
`
);
},
complete
:
function
()
{
console
.
log
(
'
vibrate is completed
'
);
console
.
info
(
'
completed in vibrating
'
);
}
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-util.md
浏览文件 @
8bfe0ac4
...
...
@@ -2080,7 +2080,7 @@ let result = that.encodeSync(array);
### encodeToStringSync<sup>9+</sup>
encodeToStringSync(src: Uint8Array): string
encodeToStringSync(src: Uint8Array
, options?: Type
): string
通过输入参数编码后输出对应文本。
...
...
@@ -2091,6 +2091,7 @@ encodeToStringSync(src: Uint8Array): string
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ---------- | ---- | ------------------- |
| src | Uint8Array | 是 | 编码输入Uint8数组。 |
| options
<sup>
10+
</sup>
|
[
Type
](
#type10
)
| 否 | 从API version 10开始支持该参数,表示对应的编码格式。
<br/>
此参数可选,可选值为:util.Type.BASIC和util.Type.MIME,默认值为:util.Type.BASIC。
<br/>
- 当参数取值为util.Type.BASIC时,输出结果包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',没有回车符、换行符。
<br/>
- 当参数取值为util.Type.MIME时,输出结果包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',编码输出每一行不超过76个字符,而且每行以'
\r\n
'符结束。|
**返回值:**
...
...
@@ -2102,14 +2103,14 @@ encodeToStringSync(src: Uint8Array): string
```
js
let
that
=
new
util
.
Base64Helper
();
let
array
=
new
Uint8Array
([
115
,
49
,
5
1
]);
let
result
=
that
.
encodeToStringSync
(
array
);
let
array
=
new
Uint8Array
([
77
,
97
,
110
,
105
,
115
,
100
,
105
,
115
,
116
,
105
,
110
,
103
,
117
,
105
,
115
,
104
,
101
,
100
,
110
,
111
,
116
,
111
,
110
,
108
,
121
,
98
,
121
,
104
,
105
,
115
,
114
,
101
,
97
,
115
,
111
,
110
,
98
,
117
,
116
,
98
,
121
,
116
,
104
,
105
,
115
,
115
,
105
,
110
,
103
,
117
,
108
,
97
,
114
,
112
,
97
,
115
,
115
,
105
,
111
,
110
,
102
,
114
,
111
,
109
,
111
,
116
,
104
,
101
,
114
,
97
,
110
,
105
,
109
,
97
,
108
,
115
,
119
,
104
,
105
,
99
,
104
,
105
,
115
,
97
,
108
,
117
,
115
,
116
,
111
,
102
,
116
,
104
,
101
,
109
,
105
,
110
,
100
,
101
,
120
,
99
,
101
,
101
,
100
,
115
,
116
,
104
,
101
,
115
,
104
,
111
,
114
,
116
,
118
,
101
,
104
,
101
,
109
,
101
,
110
,
99
,
101
,
111
,
102
,
97
,
110
,
121
,
99
,
97
,
114
,
110
,
97
,
108
,
112
,
108
,
101
,
97
,
115
,
117
,
114
,
10
1
]);
let
result
=
that
.
encodeToStringSync
(
array
,
util
.
Type
.
MIME
);
```
### decodeSync<sup>9+</sup>
decodeSync(src: Uint8Array | string): Uint8Array
decodeSync(src: Uint8Array | string
, options?: Type
): Uint8Array
通过输入参数解码后输出对应文本。
...
...
@@ -2120,6 +2121,7 @@ decodeSync(src: Uint8Array | string): Uint8Array
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------------------------ | ---- | ----------------------------- |
| src | Uint8Array
\|
string | 是 | 解码输入Uint8数组或者字符串。 |
| options
<sup>
10+
</sup>
|
[
Type
](
#type10
)
| 否 | 从API version 10开始支持该参数,表示对应的编码格式。
<br/>
此参数可选,可选值为:util.Type.BASIC和util.Type.MIME,默认值为:util.Type.BASIC。
<br/>
- 当参数取值为util.Type.BASIC时,表示入参包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',没有回车符、换行符。
<br/>
- 当参数取值为util.Type.MIME时,表示入参包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',每一行不超过76个字符,而且每行以'
\r\n
'符结束。 |
**返回值:**
...
...
@@ -2131,8 +2133,8 @@ decodeSync(src: Uint8Array | string): Uint8Array
```
js
let
that
=
new
util
.
Base64Helper
();
let
buff
=
'
czEz
'
;
let
result
=
that
.
decodeSync
(
buff
);
let
buff
=
'
TWFuaXNkaXN0aW5ndWlzaGVkbm90b25seWJ5aGlzcmVhc29uYnV0Ynl0aGlzc2luZ3VsYXJwYXNz
\r\n
aW9uZnJvbW90aGVyYW5pbWFsc3doaWNoaXNhbHVzdG9mdGhlbWluZGV4Y2VlZHN0aGVzaG9ydHZl
\r\n
aGVtZW5jZW9mYW55Y2FybmFscGxlYXN1cmU=
\r\n
'
;
let
result
=
that
.
decodeSync
(
buff
,
util
.
Type
.
MIME
);
```
...
...
@@ -2172,7 +2174,7 @@ that.encode(array).then(val=>{
### encodeToString<sup>9+</sup>
encodeToString(src: Uint8Array): Promise
<
string
>
encodeToString(src: Uint8Array
, options?: Type
): Promise
<
string
>
通过输入参数异步编码后输出对应文本。
...
...
@@ -2183,6 +2185,7 @@ encodeToString(src: Uint8Array): Promise<string>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ---------- | ---- | ----------------------- |
| src | Uint8Array | 是 | 异步编码输入Uint8数组。 |
| options
<sup>
10+
</sup>
|
[
Type
](
#type10
)
| 否 | 从API version 10开始支持该参数,表示对应的编码格式。
<br/>
此参数可选,可选值为:util.Type.BASIC和util.Type.MIME,默认值为:util.Type.BASIC。
<br/>
- 当参数取值为util.Type.BASIC时,输出结果包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',没有回车符、换行符。
<br/>
- 当参数取值为util.Type.MIME时,输出结果包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',编码输出每一行不超过76个字符,而且每行以'
\r\n
'符结束。 |
**返回值:**
...
...
@@ -2194,16 +2197,16 @@ encodeToString(src: Uint8Array): Promise<string>
```
js
let
that
=
new
util
.
Base64Helper
();
let
array
=
new
Uint8Array
([
115
,
49
,
5
1
]);
that
.
encodeToString
(
array
).
then
(
val
=>
{
console
.
log
(
val
)
let
array
=
new
Uint8Array
([
77
,
97
,
110
,
105
,
115
,
100
,
105
,
115
,
116
,
105
,
110
,
103
,
117
,
105
,
115
,
104
,
101
,
100
,
110
,
111
,
116
,
111
,
110
,
108
,
121
,
98
,
121
,
104
,
105
,
115
,
114
,
101
,
97
,
115
,
111
,
110
,
98
,
117
,
116
,
98
,
121
,
116
,
104
,
105
,
115
,
115
,
105
,
110
,
103
,
117
,
108
,
97
,
114
,
112
,
97
,
115
,
115
,
105
,
111
,
110
,
102
,
114
,
111
,
109
,
111
,
116
,
104
,
101
,
114
,
97
,
110
,
105
,
109
,
97
,
108
,
115
,
119
,
104
,
105
,
99
,
104
,
105
,
115
,
97
,
108
,
117
,
115
,
116
,
111
,
102
,
116
,
104
,
101
,
109
,
105
,
110
,
100
,
101
,
120
,
99
,
101
,
101
,
100
,
115
,
116
,
104
,
101
,
115
,
104
,
111
,
114
,
116
,
118
,
101
,
104
,
101
,
109
,
101
,
110
,
99
,
101
,
111
,
102
,
97
,
110
,
121
,
99
,
97
,
114
,
110
,
97
,
108
,
112
,
108
,
101
,
97
,
115
,
117
,
114
,
10
1
]);
that
.
encodeToString
(
array
,
util
.
Type
.
MIME
).
then
(
val
=>
{
// 根据开发者需求进行添加。
})
```
### decode<sup>9+</sup>
decode(src: Uint8Array | string): Promise
<
Uint8Array
>
decode(src: Uint8Array | string
, options?: Type
): Promise
<
Uint8Array
>
通过输入参数异步解码后输出对应文本。
...
...
@@ -2214,6 +2217,7 @@ decode(src: Uint8Array | string): Promise<Uint8Array>
| 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------------------------ | ---- | --------------------------------- |
| src | Uint8Array
\|
string | 是 | 异步解码输入Uint8数组或者字符串。 |
| options
<sup>
10+
</sup>
|
[
Type
](
#type10
)
| 否 | 从API version 10开始支持该参数,表示对应的编码格式。
<br/>
此参数可选,可选值为:util.Type.BASIC和util.Type.MIME,默认值为:util.Type.BASIC。
<br/>
- 当参数取值为util.Type.BASIC时,表示入参包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',没有回车符、换行符。
<br/>
- 当参数取值为util.Type.MIME时,表示入参包含:64个可打印字符,包括大写字母A-Z、小写字母a-z、数字0-9共62个字符,再加上另外2个'+'和'/',每一行不超过76个字符,而且每行以'
\r\n
'符结束。 |
**返回值:**
...
...
@@ -2225,15 +2229,25 @@ decode(src: Uint8Array | string): Promise<Uint8Array>
```
js
let
that
=
new
util
.
Base64Helper
();
let
array
=
new
Uint8Array
([
99
,
122
,
69
,
122
]);
let
rarray
=
new
Uint8Array
([
115
,
49
,
51
]);
that
.
decode
(
array
).
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
rarray
.
length
;
i
++
)
{
console
.
log
(
val
[
i
].
toString
())
}
let
array
=
'
TWFuaXNkaXN0aW5ndWlzaGVkbm90b25seWJ5aGlzcmVhc29uYnV0Ynl0aGlzc2luZ3VsYXJwYXNz
\r\n
aW9uZnJvbW90aGVyYW5pbWFsc3doaWNoaXNhbHVzdG9mdGhlbWluZGV4Y2VlZHN0aGVzaG9ydHZl
\r\n
aGVtZW5jZW9mYW55Y2FybmFscGxlYXN1cmU=
\r\n
'
;
that
.
decode
(
array
,
util
.
Type
.
MIME
).
then
(
val
=>
{
// 根据开发者需求进行添加。
})
```
## Type<sup>10+</sup>
Base64编码格式枚举。
**系统能力:**
SystemCapability.Utils.Lang
| 名称 | 值 | 说明 |
| -------- | ------------------------ | ---------------- |
| BASIC | 0 | 表示BASIC编码格式 |
| MIME | 1 | 表示MIME编码格式。 |
## types<sup>8+</sup>
types为不同类型的内置对象提供类型检查,可以避免由于类型错误导致的异常或崩溃。该模块包含了多个工具函数,用于判断JS对象是否属于各种类型例如:ArrayBuffer、Map、Set等。
...
...
zh-cn/application-dev/reference/apis/js-apis-vibrator.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
浏览文件 @
8bfe0ac4
...
...
@@ -3414,6 +3414,41 @@ onRequestSelected(callback: () => void)
}
```
### onOverScroll<sup>10+</sup>
onOverScroll(callback: (event: {xOffset: number, yOffset: number}) => void)
通知网页过滚动偏移量。
**参数:**
| 参数名 | 参数类型 | 参数描述 |
| ------- | ------ | ------------ |
| xOffset | number | 以网页最左端为基准,水平过滚动偏移量。 |
| yOffset | number | 以网页最上端为基准,竖直过滚动偏移量。 |
**示例:**
```
ts
// xxx.ets
import
web_webview
from
'
@ohos.web.webview
'
@
Entry
@
Component
struct
WebComponent
{
controller
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
()
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
onOverScroll
((
event
)
=>
{
console
.
info
(
"
x =
"
+
event
.
xOffset
)
console
.
info
(
"
y =
"
+
event
.
yOffset
)
})
}
}
}
```
## ConsoleMessage
Web组件获取控制台信息对象。示例代码参考
[
onConsole事件
](
#onconsole
)
。
...
...
zh-cn/application-dev/reference/arkui-ts/ts-container-tabcontent.md
浏览文件 @
8bfe0ac4
...
...
@@ -82,7 +82,7 @@ SubTabBarStyle的静态构造函数。
| -------- | -------- | -------- | -------------------------------- |
| color |
[
ResourceColor
](
ts-types.md#resourcecolor
)
| 否 | 下划线的颜色和背板颜色。
<br/>
默认值:#FF007DFF |
| height |
[
Length
](
ts-types.md#length
)
| 否 | 下划线的高度(不支持百分比设置)。
<br/>
默认值:2.0
<br/>
单位:vp |
| width |
[
Length
](
ts-types.md#length
)
| 否 | 下划线的宽度(不支持百分比设置)。
<br/>
默认值:0.0
<br/>
单位:vp |
| width |
[
Length
](
ts-types.md#length
)
| 否 | 下划线的宽度(不支持百分比设置)。
<br/>
默认值:0.0
<br/>
单位:vp
<br/>
**说明:**
<br/>
宽度设置为0时,按页签文本宽度显示。
|
| borderRadius |
[
Length
](
ts-types.md#length
)
| 否 | 下划线的圆角半径(不支持百分比设置)。
<br/>
默认值:0.0
<br/>
单位:vp |
| marginTop |
[
Length
](
ts-types.md#length
)
| 否 | 下划线与文字的间距(不支持百分比设置)。
<br/>
默认值:8.0
<br/>
单位:vp |
...
...
zh-cn/application-dev/reference/native-apis/Readme-CN.md
浏览文件 @
8bfe0ac4
...
...
@@ -31,6 +31,7 @@
-
[
Memory
](
memory.md
)
-
[
UsbDdk
](
_usb_ddk.md
)
-
[
Hitrace
](
_hitrace.md
)
-
[
Vulkan
](
_vulkan.md
)
-
头文件
-
[
drawing_bitmap.h
](
drawing__bitmap_8h.md
)
-
[
drawing_brush.h
](
drawing__brush_8h.md
)
...
...
@@ -92,6 +93,7 @@
-
[
usb_ddk_api.h
](
usb__ddk__api_8h.md
)
-
[
usb_ddk_types.h
](
usb__ddk__types_8h.md
)
-
[
trace.h
](
trace_8h.md
)
-
[
vulkan_ohos.h
](
vulkan__ohos_8h.md
)
-
结构体
-
[
OH_Drawing_BitmapFormat
](
_o_h___drawing___bitmap_format.md
)
-
[
OH_NativeBuffer_Config
](
_o_h___native_buffer___config.md
)
...
...
@@ -148,3 +150,10 @@
-
[
UsbEndpointDescriptor
](
_usb_endpoint_descriptor.md
)
-
[
UsbInterfaceDescriptor
](
_usb_interface_descriptor.md
)
-
[
UsbRequestPipe
](
_usb_request_pipe.md
)
-
[
VkExternalFormatOHOS
](
_vk_external_format_o_h_o_s.md
)
-
[
VkImportNativeBufferInfoOHOS
](
_vk_import_native_buffer_info_o_h_o_s.md
)
-
[
VkMemoryGetNativeBufferInfoOHOS
](
_vk_memory_get_native_buffer_info_o_h_o_s.md
)
-
[
VkNativeBufferFormatPropertiesOHOS
](
_vk_native_buffer_format_properties_o_h_o_s.md
)
-
[
VkNativeBufferPropertiesOHOS
](
_vk_native_buffer_properties_o_h_o_s.md
)
-
[
VkNativeBufferUsageOHOS
](
_vk_native_buffer_usage_o_h_o_s.md
)
-
[
VkSurfaceCreateInfoOHOS
](
_vk_surface_create_info_o_h_o_s.md
)
zh-cn/application-dev/reference/native-apis/_vk_external_format_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkExternalFormatOHOS
## 概述
表示外部定义的格式标识符。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-77
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-77
)
| 下一级结构体指针。 |
|
[
externalFormat
](
_vulkan.md#externalformat-22
)
| 外部定义的格式标识符。 |
zh-cn/application-dev/reference/native-apis/_vk_import_native_buffer_info_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkImportNativeBufferInfoOHOS
## 概述
包含了OH_NativeBuffer结构体的指针。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-57
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-57
)
| 下一级结构体指针。 |
|
[
buffer
](
_vulkan.md#buffer
)
| OH_NativeBuffer结构体的指针。 |
zh-cn/application-dev/reference/native-apis/_vk_memory_get_native_buffer_info_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkMemoryGetNativeBufferInfoOHOS
## 概述
用于从Vulkan内存中获取OH_NativeBuffer。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-67
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-67
)
| 下一级结构体指针。 |
|
[
memory
](
_vulkan.md#memory
)
| VkDeviceMemory对象。 |
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_format_properties_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkNativeBufferFormatPropertiesOHOS
## 概述
包含了NaitveBuffer的一些格式属性。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-47
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-47
)
| 下一级结构体指针。 |
|
[
format
](
_vulkan.md#format
)
| 格式说明。 |
|
[
externalFormat
](
_vulkan.md#externalformat-12
)
| 外部定义的格式标识符。 |
|
[
formatFeatures
](
_vulkan.md#formatfeatures
)
| 描述了与externalFormat对应的能力。 |
|
[
samplerYcbcrConversionComponents
](
_vulkan.md#samplerycbcrconversioncomponents
)
| 表示一组VkComponentSwizzle。 |
|
[
suggestedYcbcrModel
](
_vulkan.md#suggestedycbcrmodel
)
| 色彩模型。 |
|
[
suggestedYcbcrRange
](
_vulkan.md#suggestedycbcrrange
)
| 色彩数值范围。 |
|
[
suggestedXChromaOffset
](
_vulkan.md#suggestedxchromaoffset
)
| X色度偏移。 |
|
[
suggestedYChromaOffset
](
_vulkan.md#suggestedychromaoffset
)
| Y色度偏移。 |
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_properties_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkNativeBufferPropertiesOHOS
## 概述
包含了NaitveBuffer的属性。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-37
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-37
)
| 下一级结构体指针 |
|
[
allocationSize
](
_vulkan.md#allocationsize
)
| 占用的内存大小。 |
|
[
memoryTypeBits
](
_vulkan.md#memorytypebits
)
| 内存类型。 |
zh-cn/application-dev/reference/native-apis/_vk_native_buffer_usage_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkNativeBufferUsageOHOS
## 概述
提供OpenHarmony NativeBuffer用途的说明。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-27
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-27
)
| 下一级结构体指针。 |
|
[
OHOSNativeBufferUsage
](
_vulkan.md#ohosnativebufferusage
)
| NativeBuffer的用途说明。 |
zh-cn/application-dev/reference/native-apis/_vk_surface_create_info_o_h_o_s.md
0 → 100644
浏览文件 @
8bfe0ac4
# VkSurfaceCreateInfoOHOS
## 概述
包含创建Vulkan Surface时必要的参数。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 成员变量
| 名称 | 描述 |
| -------- | -------- |
|
[
sType
](
_vulkan.md#stype-17
)
| 结构体类型。 |
|
[
pNext
](
_vulkan.md#pnext-17
)
| 下一级结构体指针。 |
|
[
flags
](
_vulkan.md#flags
)
| 预留的标志类型参数。 |
|
[
window
](
_vulkan.md#window
)
| OHNativeWindow指针。 |
zh-cn/application-dev/reference/native-apis/_vulkan.md
0 → 100644
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/native-apis/vulkan__ohos_8h.md
0 → 100644
浏览文件 @
8bfe0ac4
# vulkan_ohos.h
## 概述
定义了OpenHarmony平台扩展的Vulkan接口。引用文件:
<
vulkan/vulkan.h
>
。
**起始版本:**
10
**相关模块:**
[
Vulkan
](
_vulkan.md
)
## 汇总
### 结构体
| 名称 | 描述 |
| -------- | -------- |
|
[
VkSurfaceCreateInfoOHOS
](
_vk_surface_create_info_o_h_o_s.md
)
| 包含创建Vulkan Surface时必要的参数。 |
|
[
VkNativeBufferUsageOHOS
](
_vk_native_buffer_usage_o_h_o_s.md
)
| 提供OpenHarmony NativeBuffer用途的说明。 |
|
[
VkNativeBufferPropertiesOHOS
](
_vk_native_buffer_properties_o_h_o_s.md
)
| 包含了NaitveBuffer的属性。 |
|
[
VkNativeBufferFormatPropertiesOHOS
](
_vk_native_buffer_format_properties_o_h_o_s.md
)
| 包含了NaitveBuffer的一些格式属性。 |
|
[
VkImportNativeBufferInfoOHOS
](
_vk_import_native_buffer_info_o_h_o_s.md
)
| 包含了OH_NativeBuffer结构体的指针。 |
|
[
VkMemoryGetNativeBufferInfoOHOS
](
_vk_memory_get_native_buffer_info_o_h_o_s.md
)
| 用于从Vulkan内存中获取OH_NativeBuffer。 |
|
[
VkExternalFormatOHOS
](
_vk_external_format_o_h_o_s.md
)
| 表示外部定义的格式标识符。 |
### 宏定义
| 名称 | 描述 |
| -------- | -------- |
|
[
VK_OHOS_surface
](
_vulkan.md#vk_ohos_surface
)
1 | OpenHarmony平台Surface扩展宏定义。 |
|
[
VK_OHOS_SURFACE_SPEC_VERSION
](
_vulkan.md#vk_ohos_surface_spec_version
)
1 | OpenHarmony平台Surface扩展版本号。 |
|
[
VK_OHOS_SURFACE_EXTENSION_NAME
](
_vulkan.md#vk_ohos_surface_extension_name
)
"VK_OHOS_surface" | OpenHarmony平台Surface扩展名。 |
|
[
VK_OHOS_external_memory
](
_vulkan.md#vk_ohos_external_memory
)
1 | OpenHarmony平台external_memory扩展宏定义。 |
|
[
VK_OHOS_EXTERNAL_MEMORY_SPEC_VERSION
](
_vulkan.md#vk_ohos_external_memory_spec_version
)
1 | OpenHarmony平台external_memory扩展版本号。 |
|
[
VK_OHOS_EXTERNAL_MEMORY_EXTENSION_NAME
](
_vulkan.md#vk_ohos_external_memory_extension_name
)
"VK_OHOS_external_memory" | OpenHarmony平台external_memory扩展名。 |
### 类型定义
| 名称 | 描述 |
| -------- | -------- |
|
[
OHNativeWindow
](
_vulkan.md#ohnativewindow
)
| OH本地窗口。 |
|
[
VkSurfaceCreateFlagsOHOS
](
_vulkan.md#vksurfacecreateflagsohos
)
| 用于Vulkan Surface创建时使用到的VkFlags类型位掩码,预留的标志类型。 |
|
[
VkSurfaceCreateInfoOHOS
](
_vulkan.md#vksurfacecreateinfoohos
)
| 包含创建Vulkan Surface时必要的参数。 |
| VkResult (
[
VKAPI_PTR *PFN_vkCreateSurfaceOHOS
](
_vulkan.md#pfn_vkcreatesurfaceohos
)
) (VkInstance instance, const
[
VkSurfaceCreateInfoOHOS
](
_vk_surface_create_info_o_h_o_s.md
)
\*
pCreateInfo, const VkAllocationCallbacks
\*
pAllocator, VkSurfaceKHR
\*
pSurface) | 创建Vulkan Surface的函数指针定义。 |
|
[
VkNativeBufferUsageOHOS
](
_vulkan.md#vknativebufferusageohos
)
| 提供OpenHarmony NativeBuffer用途的说明。 |
|
[
VkNativeBufferPropertiesOHOS
](
_vulkan.md#vknativebufferpropertiesohos
)
| 包含了NaitveBuffer的属性。 |
|
[
VkNativeBufferFormatPropertiesOHOS
](
_vulkan.md#vknativebufferformatpropertiesohos
)
| 包含了NaitveBuffer的一些格式属性。 |
|
[
VkImportNativeBufferInfoOHOS
](
_vulkan.md#vkimportnativebufferinfoohos
)
| 包含了OH_NativeBuffer结构体的指针。 |
|
[
VkMemoryGetNativeBufferInfoOHOS
](
_vulkan.md#vkmemorygetnativebufferinfoohos
)
| 用于从Vulkan内存中获取OH_NativeBuffer。 |
|
[
VkExternalFormatOHOS
](
_vulkan.md#vkexternalformatohos
)
| 表示外部定义的格式标识符。 |
| VkResult (
[
VKAPI_PTR *PFN_vkGetNativeBufferPropertiesOHOS
](
_vulkan.md#pfn_vkgetnativebufferpropertiesohos
)
) (VkDevice device, const struct OH_NativeBuffer
\*
buffer,
[
VkNativeBufferPropertiesOHOS
](
_vk_native_buffer_properties_o_h_o_s.md
)
\*
pProperties) | 获取OH_NativeBuffer属性的函数指针定义。 |
| VkResult (
[
VKAPI_PTR *PFN_vkGetMemoryNativeBufferOHOS
](
_vulkan.md#pfn_vkgetmemorynativebufferohos
)
) (VkDevice device, const
[
VkMemoryGetNativeBufferInfoOHOS
](
_vk_memory_get_native_buffer_info_o_h_o_s.md
)
\*
pInfo, struct OH_NativeBuffer
\*\*
pBuffer) | 获取OH_NativeBuffer的函数指针定义。 |
### 函数
| 名称 | 描述 |
| -------- | -------- |
|
[
vkCreateSurfaceOHOS
](
_vulkan.md#vkcreatesurfaceohos
)
(
VkInstance
instance, const
[
VkSurfaceCreateInfoOHOS
](
_vk_surface_create_info_o_h_o_s.md
)
\*
pCreateInfo, const VkAllocationCallbacks
\*
pAllocator, VkSurfaceKHR
\*
pSurface) | 创建Vulkan Surface。 |
|
[
vkGetNativeBufferPropertiesOHOS
](
_vulkan.md#vkgetnativebufferpropertiesohos
)
(
VkDevice
device, const struct OH_NativeBuffer
\*
buffer,
[
VkNativeBufferPropertiesOHOS
](
_vk_native_buffer_properties_o_h_o_s.md
)
\*
pProperties) | 获取OH_NativeBuffer属性。 |
|
[
vkGetMemoryNativeBufferOHOS
](
_vulkan.md#vkgetmemorynativebufferohos
)
(
VkDevice
device, const
[
VkMemoryGetNativeBufferInfoOHOS
](
_vk_memory_get_native_buffer_info_o_h_o_s.md
)
\*
pInfo, struct OH_NativeBuffer
\*\*
pBuffer) | 获取OH_NativeBuffer。 |
zh-cn/application-dev/website.md
浏览文件 @
8bfe0ac4
...
...
@@ -1096,7 +1096,7 @@
-
[
@ohos.enterprise.dateTimeManager (系统时间管理)
](
reference/apis/js-apis-enterprise-dateTimeManager.md
)
-
[
@ohos.enterprise.deviceControl (设备控制管理)
](
reference/apis/js-apis-enterprise-deviceControl.md
)
-
[
@ohos.enterprise.deviceInfo (设备信息管理)
](
reference/apis/js-apis-enterprise-deviceInfo.md
)
-
[
@ohos.enterprise.deviceSettings (设备设置管理)
](
reference/apis/js-apis-enterprise-deviceSetings.md
)
-
[
@ohos.enterprise.deviceSettings (设备设置管理)
](
reference/apis/js-apis-enterprise-deviceSet
t
ings.md
)
-
[
@ohos.enterprise.EnterpriseAdminExtensionAbility (企业设备管理扩展能力)
](
reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
)
-
[
@ohos.enterprise.networkManager (网络管理)
](
reference/apis/js-apis-enterprise-networkManager.md
)
-
[
@ohos.enterprise.wifiManager (WiFi管理)
](
reference/apis/js-apis-enterprise-wifiManager.md
)
...
...
zh-cn/device-dev/Readme-CN.md
浏览文件 @
8bfe0ac4
...
...
@@ -34,7 +34,6 @@
-
[
标准系统内核
](
kernel/kernel-standard-overview.md
)
-
[
驱动
](
driver/Readme-CN.md
)
-
[
编译构建
](
subsystems/subsys-build-all.md
)
-
[
分布式远程启动
](
subsystems/subsys-remote-start.md
)
-
[
图形图像
](
subsystems/subsys-graphics-overview.md
)
-
[
媒体
](
subsystems/subsys-multimedia-camera-overview.md
)
-
[
公共基础
](
subsystems/subsys-utils-guide.md
)
...
...
zh-cn/device-dev/driver/driver-peripherals-audio-des.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/device-dev/kernel/Readme-CN.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/device-dev/security/Readme-CN.md
浏览文件 @
8bfe0ac4
#
security
#
隐私与安全
-
隐私与安全
-
[
隐私保护
](
security-privacy-protection.md
)
- [安全指南](security-guidelines-overall.md)
-
[
隐私保护
](
security-privacy-protection.md
)
-
[
安全指南
](
security-guidelines-overall.md
)
zh-cn/device-dev/subsystems/Readme-CN.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/device-dev/website.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
zh-cn/release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md
浏览文件 @
8bfe0ac4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录