未验证 提交 6ce0b0f9 编写于 作者: O openharmony_ci 提交者: Gitee

!8403 master:更新指南中的samples:无需同步翻译

Merge pull request !8403 from 葛亚芳/master
......@@ -29,9 +29,9 @@ Ability框架在API 8及更早版本使用FA模型。FA模型中Ability分为Pag
## 相关实例
针对Ability开发,有以下相关实例可供参考:
- [`DistributeCalc`:分布式计算器(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Preset/DistributeCalc)
- [`DistributeGraffiti`:分布式涂鸦(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DistributedGraffiti)
- [`DistributedCalc`:分布式计算器(JS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/DistributeCalc)
- [`DistributedCalc`:分布式计算器(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/DistributeCalc)
- [`DistributeGraffiti`:分布式涂鸦(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/DistributedGraffiti)
- [分布式调度启动远程FA(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/RemoteStartFA)
- [分布式新闻客户端(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/NewsDemo)
- [分布式手写板(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/Distributed/DistributeDatabaseDrawEts)
......
......@@ -311,4 +311,4 @@ URI示例:
针对DataAbility开发,有以下相关实例可供参考:
- [`DataAbility`:DataAbility的创建与访问(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DataAbility)
- [`DataAbility`:DataAbility的创建与访问(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/DataAbility)
......@@ -404,5 +404,5 @@ onUpdate(formId) {
## 相关实例
针对FA模型卡片提供方的开发,有以下相关实例可供参考:
- [`FormAbility`:FA模型卡片(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/FormAbility)
- [`FormLauncher`:卡片使用方(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/FormLauncher)
\ No newline at end of file
- [`FormAbility`:FA模型卡片(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/FormAbility)
- [`FormLauncher`:卡片使用方(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/FormLauncher)
\ No newline at end of file
......@@ -227,4 +227,4 @@ export default {
针对PageAbility开发,有以下相关实例可供参考:
- [`DMS`:分布式Demo(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
\ No newline at end of file
- [`DMS`:分布式Demo(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/DMS)
\ No newline at end of file
......@@ -128,7 +128,7 @@ let promise = featureAbility.startAbility(
使用OpenHarmony IDL(OpenHarmony Interface Definition Language)来自动生成对应客户端服务端及IRemoteObject代码,具体示例代码和说明请参考:
- [`OpenHarmony IDL`:TS开发步骤](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/IDL/idl-guidelines.md#32-ts开发步骤)
- [`OpenHarmony IDL`:TS开发步骤](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/IDL/idl-guidelines.md#ts开发步骤)
2. 在对应文件编写代码
......@@ -220,7 +220,7 @@ let promise = featureAbility.startAbility(
}
```
### 连接远程Service<a name="section126857614019"></a>(当前仅对系统应用开放)
### 连接远程Service(当前仅对系统应用开放)
>说明:由于DeviceManager的getTrustedDeviceListSync接口仅对系统应用开放,当前连接远程Service仅支持系统应用。
......@@ -406,5 +406,5 @@ export default {
## 相关实例
针对ServiceAbility开发,有以下相关实例可供参考:
- [`ServiceAbility`:ServiceAbility的创建与使用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceAbility)
- [`DMS`:分布式Demo(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
- [`ServiceAbility`:ServiceAbility的创建与使用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/ServiceAbility)
- [`DMS`:分布式Demo(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/DMS)
......@@ -324,4 +324,4 @@ struct Index {
## 相关实例
针对Stage模型Ability开发,有以下相关示例可供参考:
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/StageCallAbility)
......@@ -97,4 +97,5 @@
![stageprocessmodel](figures/stageprocessmodel.png)
## 相关实例
针对Stage模型下的Ability开发,有以下相关实例可供参考:
- [`MissionManager`:系统任务管理(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/MissionManager)
- [`MissionManager`:系统任务管理(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/MissionManager)
- [`Launcher`:仿桌面应用(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/Launcher)
......@@ -284,4 +284,4 @@ releaseCall() {
## 相关实例
针对Stage模型本地Call功能开发,有以下相关实例可供参考:
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/StageCallAbility)
- [`StageCallAbility`:StageCallAbility的创建与使用(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/StageCallAbility)
......@@ -415,4 +415,5 @@ onUpdate(formId) {
## 相关实例
针对Stage模型卡片提供方的开发,有以下相关实例可供参考:
- [`FormExtAbility`:Stage模型卡片(eTS JS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/FormExtAbility)
\ No newline at end of file
- [`FormExtAbility`:Stage模型卡片(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/FormExtAbility)
- [`GalleryForm`:图库卡片(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/GalleryForm)
\ No newline at end of file
......@@ -75,4 +75,4 @@ OpenHarmony当前不支持三方应用创建ServiceExtensionAbility。
## 相关实例
针对ServiceExtensionAbility开发,有以下相关实例可供参考:
- [`ServiceExtAbility`:StageExtAbility的创建与使用(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ability/ServiceExtAbility)
- [`ServiceExtAbility`:StageExtAbility的创建与使用(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/ServiceExtAbility)
......@@ -256,11 +256,7 @@
```
## 相关实例
针对分布式数据对象,有以下开发实例可供参考:
- [`DistributedNote`:分布式备忘录(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedNote)
- [备忘录应用](https://gitee.com/openharmony/distributeddatamgr_objectstore/tree/master/samples/distributedNotepad)
在备忘录应用中,当某一个设备上的备忘录事件发生变更时,通过分布式数据对象将事件变更同步在可信组网内的其他设备上,比如新增备忘录事件、编辑事件标题和内容、清空事件列表
等。
针对分布式数据对象,有以下相关实例可供参考:
- [`DistributedNote`:分布式备忘录(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DistributedNote)
- [`DistributedObjectDms`:分布式跑马灯(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DistributedObjectDms)
......@@ -29,11 +29,13 @@
以单版本分布式数据库为例,说明开发步骤。
1. 导入模块。
```js
import distributedData from '@ohos.data.distributedData';
```
2. 根据配置构造分布式数据库管理类实例。
1. 根据应用上下文创建`kvManagerConfig`对象。
2. 创建分布式数据库管理器实例。
......@@ -62,6 +64,7 @@
```
3. 获取/创建分布式数据库。
1. 声明需要创建的分布式数据库ID描述。
2. 创建分布式数据库,建议关闭自动同步功能(`autoSync:false`),需要同步时主动调用`sync`接口。
......@@ -95,6 +98,7 @@
> 组网设备间同步数据的场景,建议在应用启动时打开分布式数据库,获取数据库的句柄。在该句柄(如示例中的`kvStore`)的生命周期内无需重复创建数据库,可直接使用句柄对数据库进行数据的插入等操作。
4. 订阅分布式数据变化。
以下为订阅单版本分布式数据库数据变化通知的代码示例:
```js
kvStore.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_ALL, function (data) {
......@@ -103,6 +107,7 @@
```
5. 将数据写入分布式数据库。
1. 构造需要写入分布式数据库的`Key`(键)和`Value`(值)。
2. 将键值数据写入分布式数据库。
......@@ -125,6 +130,7 @@
```
6. 查询分布式数据库数据。
1. 构造需要从单版本分布式数据库中查询的`Key`(键)。
2. 从单版本分布式数据库中获取数据。
......@@ -149,6 +155,7 @@
```
7. 同步数据到其他设备。
选择同一组网环境下的设备以及同步模式,进行数据同步。
> **说明**:
......@@ -182,8 +189,12 @@
});
```
## 相关实例
针对分布式数据开发,有以下相关实例可供参考:
- [`DistributedDataGobang`:分布式五子棋(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedDataGobang)
- [`DDMQuery`:结果集与谓词(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/DDMQuery)
- [`KvStore`:分布式数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/Kvstore)
- [`DistributedCalc`:分布式计算器(JS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/DistributeCalc)
- [`DistributedCalc`:分布式计算器(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/DistributeCalc)
- [`DistributedDataGobang`:分布式五子棋(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DistributedDataGobang)
- [`DDMQuery`:结果集与谓词(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DDMQuery)
- [`KvStore`:分布式数据库(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/Kvstore)
- [分布式数据库(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/Data/JsDistributedData)
\ No newline at end of file
......@@ -173,4 +173,4 @@
## 相关实例
针对首选项开发,有以下相关实例可供参考:
- [`Preferences`:首选项(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/data/Preferences)
\ No newline at end of file
- [`Preferences`:首选项(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/Preferences)
\ No newline at end of file
......@@ -387,5 +387,5 @@
## 相关实例
针对关系型数据库开发,有以下相关实例可供参考:
- [`DistributedRdb`:分布式关系型数据库(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/data/DistributedRdb)
- [`DistributedRdb`:分布式关系型数据库(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/data/DistributedRdb)
- [关系型数据库(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/Data/JSRelationshipData)
\ No newline at end of file
......@@ -438,5 +438,5 @@ import stats from '@ohos.bundleState';
```
## 相关实例
针对设备使用信息统计,有以下相关实例可供参考:
- [`DeviceUsageStatistics`:设备使用信息统计(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/device/DeviceUsageStatistics)
- [`DeviceUsageStatistics`:设备使用信息统计(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/DeviceUsageStatistics)
......@@ -155,4 +155,4 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例
```
## 相关实例
针对USB管理开发,有以下相关实例可供参考:
- [`USBManager`:USB管理(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/device/USBManager)
- [`USBManager`:USB管理(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/USBManager)
......@@ -643,6 +643,6 @@ export default {
```
## 相关实例
针对Native API的开发,有以下相关实例可供参考:
- [`NativeAPI`:NativeAPI(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Native/NativeAPI)
- [`NativeAPI`:NativeAPI(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/Native/NativeAPI)
- [第一个Native C++应用(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/NativeTemplateDemo)
- [Native Component(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/NativeAPI/XComponent)
\ No newline at end of file
......@@ -233,3 +233,8 @@
![zh-cn_image_0000001363934589](figures/zh-cn_image_0000001363934589.png)
恭喜您已经使用JS语言开发(FA模型)完成了第一个OpenHarmony应用,快来[探索更多的OpenHarmony功能](../application-dev-guide.md)吧。
## 相关实例
针对使用JS语言开发(FA模型),有以下相关实例可供参考:
- [`JsHelloWorld`:你好世界(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/JsHelloWorld)
......@@ -704,4 +704,4 @@ WebGL主要帮助开发者在前端开发中完成图形图像的相关处理,
针对WebGL开发,有以下相关实例可供参考:
- [`JsWbgGL`:WebGL(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Graphics/JsWebGL)
- [`JsWbgGL`:WebGL(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/Graphics/JsWebGL)
\ No newline at end of file
......@@ -404,3 +404,7 @@ class MainAbility extends Ability {
}
};
```
## 相关实例
针对window开发(Stage模型),有以下相关实例可供参考:
- [`Window`:窗口(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/Graphics/Window)
\ No newline at end of file
......@@ -23,5 +23,5 @@ display.getDefaultDisplay().then((disp) => {
```
## 相关实例
针对屏幕属性开发,有以下相关实例可供参考:
- [`Screen`:屏幕属性(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/device/Screen)
- [`Screen`:屏幕属性(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Screen)
......@@ -37,5 +37,5 @@ screenshot.save(ScreenshotOptions).then((image) => {
```
## 相关实例
针对屏幕截图开发,有以下相关实例可供参考:
- [`Screenshot`:屏幕截图(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/Basic/Screenshot)
- [`Screenshot`:屏幕截图(eTS)(API9)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/Basic/Screenshot)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册