Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
316bdcf4
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看板
未验证
提交
316bdcf4
编写于
9月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!9499 3.1Release分支:文档拼写错误修改:无需同步翻译
Merge pull request !9499 from 葛亚芳/OpenHarmony-3.1-Release
上级
aa00b6d0
a2015e34
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
21 deletion
+27
-21
en/application-dev/reference/apis/js-apis-data-storage.md
en/application-dev/reference/apis/js-apis-data-storage.md
+9
-9
zh-cn/application-dev/device/usb-guidelines.md
zh-cn/application-dev/device/usb-guidelines.md
+1
-1
zh-cn/application-dev/napi/native-window-guidelines.md
zh-cn/application-dev/napi/native-window-guidelines.md
+8
-2
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
+9
-9
未找到文件。
en/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
316bdcf4
...
@@ -54,7 +54,7 @@ var path;
...
@@ -54,7 +54,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
let
storage
=
data_storage
.
getStorageSync
(
path
+
'
/mystore
'
);
let
storage
=
data_storage
.
getStorageSync
(
path
+
'
/mystore
'
);
...
@@ -87,7 +87,7 @@ var path;
...
@@ -87,7 +87,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
data_storage
.
getStorage
(
path
+
'
/mystore
'
,
function
(
err
,
storage
)
{
data_storage
.
getStorage
(
path
+
'
/mystore
'
,
function
(
err
,
storage
)
{
...
@@ -130,7 +130,7 @@ var path;
...
@@ -130,7 +130,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
let
getPromise
=
data_storage
.
getStorage
(
path
+
'
/mystore
'
);
let
getPromise
=
data_storage
.
getStorage
(
path
+
'
/mystore
'
);
...
@@ -166,7 +166,7 @@ var path;
...
@@ -166,7 +166,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
data_storage
.
deleteStorageSync
(
path
+
'
/mystore
'
);
data_storage
.
deleteStorageSync
(
path
+
'
/mystore
'
);
...
@@ -197,7 +197,7 @@ var path;
...
@@ -197,7 +197,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
,
function
(
err
)
{
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
,
function
(
err
)
{
...
@@ -238,7 +238,7 @@ var path;
...
@@ -238,7 +238,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
let
promisedelSt
=
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
);
let
promisedelSt
=
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
);
...
@@ -273,7 +273,7 @@ var path;
...
@@ -273,7 +273,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
data_storage
.
removeStorageFromCacheSync
(
path
+
'
/mystore
'
);
data_storage
.
removeStorageFromCacheSync
(
path
+
'
/mystore
'
);
...
@@ -304,7 +304,7 @@ var path;
...
@@ -304,7 +304,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
,
function
(
err
)
{
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
,
function
(
err
)
{
...
@@ -346,7 +346,7 @@ var path;
...
@@ -346,7 +346,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
});
});
let
promiserevSt
=
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
)
let
promiserevSt
=
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
)
...
...
zh-cn/application-dev/device/usb-guidelines.md
浏览文件 @
316bdcf4
...
@@ -39,7 +39,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例
...
@@ -39,7 +39,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例
1.
获取设备列表。
1.
获取设备列表。
```
js
```
js
// 导入
usb
接口api包。
// 导入
USB
接口api包。
import
usb
from
'
@ohos.usb
'
;
import
usb
from
'
@ohos.usb
'
;
// 获取设备列表。
// 获取设备列表。
var
deviceList
=
usb
.
getDevices
();
var
deviceList
=
usb
.
getDevices
();
...
...
zh-cn/application-dev/napi/native-window-guidelines.md
浏览文件 @
316bdcf4
...
@@ -86,7 +86,7 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
...
@@ -86,7 +86,7 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
SkImageInfo imageInfo = ...
SkImageInfo imageInfo = ...
bitmap.setInfo(imageInfo, bufferHandle->stride);
bitmap.setInfo(imageInfo, bufferHandle->stride);
bitmap.setPixels(bufferHandle->virAddr);
bitmap.setPixels(bufferHandle->virAddr);
//创建 Skia Canvas 并将内容写入na
it
ve window
//创建 Skia Canvas 并将内容写入na
ti
ve window
...
...
//写入完成后,通过OH_NativeWindwo_NativeWindowFlushBuffer 提交给消费者使用,例如:显示在屏幕上
//写入完成后,通过OH_NativeWindwo_NativeWindowFlushBuffer 提交给消费者使用,例如:显示在屏幕上
...
@@ -101,7 +101,13 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
...
@@ -101,7 +101,13 @@ NativeWindow是`OpenHarmony`**本地平台化窗口**,包括从`Surface`构建
OH_NativeXComponent_Callback &callback_;
OH_NativeXComponent_Callback &callback_;
callback_->OnSurfaceCreated = OnSufaceCreatedCB;
callback_->OnSurfaceCreated = OnSufaceCreatedCB;
callback_->OnSurfaceChanged = OnSufaceChangedCB;
callback_->OnSurfaceChanged = OnSufaceChangedCB;
callback_->OnSurfaceDest
oryed = OnSufaceDestor
yedCB;
callback_->OnSurfaceDest
royed = OnSufaceDestro
yedCB;
callback_->DispatchTouchEvent = DispatchTouchEventCB;
callback_->DispatchTouchEvent = DispatchTouchEventCB;
OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_)
OH_NativeXComponent_RegisterCallback(nativeXComponent, callback_)
```
```
## 相关实例
针对NativeWindow的使用,有以下相关实例可供参考:
-
[
使用NativeWindow接口获取Buffer
](
https://gitee.com/openharmony/graphic_graphic_2d/blob/master/rosen/samples/hello_native_window/hello_native_window.cpp
)
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-data-storage.md
浏览文件 @
316bdcf4
...
@@ -53,7 +53,7 @@ var path;
...
@@ -53,7 +53,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
let
storage
=
data_storage
.
getStorageSync
(
path
+
'
/mystore
'
);
let
storage
=
data_storage
.
getStorageSync
(
path
+
'
/mystore
'
);
storage
.
putSync
(
'
startup
'
,
'
auto
'
);
storage
.
putSync
(
'
startup
'
,
'
auto
'
);
...
@@ -86,7 +86,7 @@ var path;
...
@@ -86,7 +86,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
data_storage
.
getStorage
(
path
+
'
/mystore
'
,
function
(
err
,
storage
)
{
data_storage
.
getStorage
(
path
+
'
/mystore
'
,
function
(
err
,
storage
)
{
if
(
err
)
{
if
(
err
)
{
...
@@ -129,7 +129,7 @@ var path;
...
@@ -129,7 +129,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
let
getPromise
=
data_storage
.
getStorage
(
path
+
'
/mystore
'
);
let
getPromise
=
data_storage
.
getStorage
(
path
+
'
/mystore
'
);
getPromise
.
then
((
storage
)
=>
{
getPromise
.
then
((
storage
)
=>
{
...
@@ -165,7 +165,7 @@ var path;
...
@@ -165,7 +165,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
data_storage
.
deleteStorageSync
(
path
+
'
/mystore
'
);
data_storage
.
deleteStorageSync
(
path
+
'
/mystore
'
);
});
});
...
@@ -195,7 +195,7 @@ var path;
...
@@ -195,7 +195,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
,
function
(
err
)
{
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
...
@@ -237,7 +237,7 @@ var path;
...
@@ -237,7 +237,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
let
promisedelSt
=
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
);
let
promisedelSt
=
data_storage
.
deleteStorage
(
path
+
'
/mystore
'
);
promisedelSt
.
then
(()
=>
{
promisedelSt
.
then
(()
=>
{
...
@@ -271,7 +271,7 @@ var path;
...
@@ -271,7 +271,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
data_storage
.
removeStorageFromCacheSync
(
path
+
'
/mystore
'
);
data_storage
.
removeStorageFromCacheSync
(
path
+
'
/mystore
'
);
});
});
...
@@ -302,7 +302,7 @@ var path;
...
@@ -302,7 +302,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
,
function
(
err
)
{
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
,
function
(
err
)
{
if
(
err
)
{
if
(
err
)
{
...
@@ -344,7 +344,7 @@ var path;
...
@@ -344,7 +344,7 @@ var path;
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
context
.
getFilesDir
().
then
((
filePath
)
=>
{
context
.
getFilesDir
().
then
((
filePath
)
=>
{
path
=
filePath
;
path
=
filePath
;
console
.
info
(
"
======================>getFilesDirProm
si
e====================>
"
);
console
.
info
(
"
======================>getFilesDirProm
is
e====================>
"
);
let
promiserevSt
=
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
)
let
promiserevSt
=
data_storage
.
removeStorageFromCache
(
path
+
'
/mystore
'
)
promiserevSt
.
then
(()
=>
{
promiserevSt
.
then
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录