diff --git a/en/application-dev/quick-start/Readme-EN.md b/en/application-dev/quick-start/Readme-EN.md index 4a20e307cd19ab1abadd85e85b4000ed598a3d2e..5ab7f8de5480acacde685aaee398ceaa9d65a3d1 100644 --- a/en/application-dev/quick-start/Readme-EN.md +++ b/en/application-dev/quick-start/Readme-EN.md @@ -6,8 +6,3 @@ - [Creating an OpenHarmony Project](creating-an-openharmony-project.md) - [Configuring the OpenHarmony App Signature](configuring-the-openharmony-app-signature.md) - [Installing and Running Your OpenHarmony App](installing-and-running-your-openharmony-app.md) - -- [Getting Started](getting-started.md) - - [Preparations](preparations.md) - - [Getting Started with JavaScript](getting-started-with-javascript.md) - diff --git a/en/application-dev/quick-start/getting-started-with-javascript.md b/en/application-dev/quick-start/getting-started-with-javascript.md deleted file mode 100644 index 617db59fa4d0d6528ce3fcbe18f9db4d386e91b3..0000000000000000000000000000000000000000 --- a/en/application-dev/quick-start/getting-started-with-javascript.md +++ /dev/null @@ -1,112 +0,0 @@ -# Getting Started with JavaScript - -- [Building the First Page](#section17436202895811) -- [Creating the Second Page](#section944219415598) -- [Implementing Page Redirection](#section126857614017) - -## Building the First Page - -1. Add a **Text** and a **Button** component to the first page. - - In the **Project** window, choose **entry** \> **src** \> **main** \> **js** \> **default** \> **pages.index**, open the **index.hml** file, and add the components. - - ``` - -
- - - Hello World - - - -
- ``` - -2. Open the **index.css** file and set text and button styles. - - ``` - /* index.css */ - .container { - flex-direction: column; /* Arrange container items vertically. */ - justify-content: center; /* Center the items along the main axis of the container. */ - align-items: center; /* Center the items along the cross axis of the container. */ - } - /* Set the style for the component of the text class. */ - .text{ - font-size: 42px; - } - /* Set the style for the component of the button class. */ - .button { - width: 240px; - height: 60px; - background-color: #007dff; - font-size: 30px; - text-color: white; - margin-top: 20px; - } - ``` - -3. [Preview](https://developer.harmonyos.com/en/docs/documentation/doc-guides/previewer-0000001054328973#EN-US_TOPIC_0000001056725592__section16523172216252) or [run your app on the emulator](https://developer.harmonyos.com/en/docs/documentation/doc-guides/run_simulator-0000001053303709). The following figure shows the running effect. - - ![](figures/1.png) - - -## Creating the Second Page - -1. In the **Project** window, choose **entry** \> **src** \> **main** \> **js** \> **default**, right-click the **pages.index** folder, and choose **New** \> **JS Page**. Name the new page **details** and press **Enter**. - - Below is the structure of the **pages.index** folder: - - ![](figures/1-0.png) - -2. Open the **details.hml** file, add the **** component, and set its layout. - - ``` - -
- - Hi there - -
- ``` - -3. Open the **details.css** file and set the text style. - - ``` - /* details.css */ - .container { - flex-direction: column; - justify-content: center; - align-items: center; - } - .text { - font-size: 42px; - text-align: center; - } - ``` - - -## Implementing Page Redirection - -1. Open the **index.js** file and import the router module. The page router redirects to the target page based on its URI. - - ``` - // index.js - import router from '@system.router'; - - export default { - launch() { - router.push ({ - uri:'pages/index/details/details', // Specify the page to be redirected to. - }) - } - } - ``` - -2. [Preview](https://developer.harmonyos.com/en/docs/documentation/doc-guides/previewer-0000001054328973#EN-US_TOPIC_0000001056725592__section16523172216252) or [run your app on the emulator](https://developer.harmonyos.com/en/docs/documentation/doc-guides/run_simulator-0000001053303709) again. The following figure shows the running effect. - - ![](figures/2.png) - - -Congratulations! You have finished developing your HarmonyOS app in JavaScript. - diff --git a/en/application-dev/quick-start/getting-started.md b/en/application-dev/quick-start/getting-started.md deleted file mode 100644 index 24988d12328b8f03c37f3bd2d1cde4c0024b6e26..0000000000000000000000000000000000000000 --- a/en/application-dev/quick-start/getting-started.md +++ /dev/null @@ -1,7 +0,0 @@ -# Getting Started - -- **[Preparations](preparations.md)** - -- **[Getting Started with JavaScript](getting-started-with-javascript.md)** - - diff --git a/en/application-dev/quick-start/preparations.md b/en/application-dev/quick-start/preparations.md deleted file mode 100644 index f25977d4ebb0c1c4cceb4ebe169727a8ebdf88d2..0000000000000000000000000000000000000000 --- a/en/application-dev/quick-start/preparations.md +++ /dev/null @@ -1,25 +0,0 @@ -# Preparations - -- [Task Description](#section2073881513322) -- [Before You Start](#section11843205017326) - -## Task Description - -This document is intended for novices at developing OpenHarmony apps. You will learn the development procedure from the following sections to build two pages and implement redirection from the first page to the second one. The following figure shows how the pages look on the [Previewer](https://developer.harmonyos.com/en/docs/documentation/doc-guides/previewer-0000001054328973#ZH-CN_TOPIC_0000001056725592__section16523172216252). - -For best results, use the latest version of DevEco Studio. Click [here](https://developer.harmonyos.com/en/develop/deveco-studio#download) if you want to download the latest DevEco Studio. - -![](figures/3.png) - -If your DevEco Studio is V2.2 Beta1 or later, you can also use HarmonyOS low-code development to visualize your development with a variety of UI editing features. HarmonyOS low-code development allows you to build your UI in compliance with the [HarmonyOS JavaScript development specifications](https://developer.harmonyos.com/en/docs/documentation/doc-references/js-apis-overview-0000001056361791) more efficiently and cost-effectively. - -## Before You Start - -1. [Configure the OpenHarmony SDK](../quick-start/configuring-the-openharmony-sdk.md). -2. Create a project by referring to [Creating and Running a Hello World Project](https://developer.harmonyos.com/en/docs/documentation/doc-guides/hello_world-0000001054516888). Select **Phone** as the device type. - - If you are using the JavaScript language, select **Empty Ability\(JS\)** for **Template**. - -3. Use the [previewer](https://developer.harmonyos.com/en/docs/documentation/doc-guides/previewer-0000001054328973#EN-US_TOPIC_0000001056725592__section16523172216252) or [phone emulator](https://developer.harmonyos.com/en/docs/documentation/doc-guides/run_simulator-0000001053303709) to run the project. - -Now you have created your first OpenHarmony project. You can continue the development by referring to [Getting Started with JavaScript](getting-started-with-javascript.md). - diff --git a/zh-cn/application-dev/quick-start/Readme-CN.md b/zh-cn/application-dev/quick-start/Readme-CN.md index 4639968354201c23b7d178ec7283c0a02f923c6a..f210ba54980824750f603b8977300d520a415ff4 100755 --- a/zh-cn/application-dev/quick-start/Readme-CN.md +++ b/zh-cn/application-dev/quick-start/Readme-CN.md @@ -6,9 +6,5 @@ - [创建OpenHarmony工程](创建OpenHarmony工程.md) - [配置OpenHarmony应用签名信息](配置OpenHarmony应用签名信息.md) - [安装运行OpenHarmony应用](安装运行OpenHarmony应用.md) - - [包结构说明](包结构说明.md) -- [快速入门](快速入门.md) - - [开发准备](开发准备.md) - - [使用JS语言开发](使用JS语言开发.md) diff --git a/zh-cn/application-dev/quick-start/figures/1.png b/zh-cn/application-dev/quick-start/figures/1.png deleted file mode 100755 index cb05a7cb0fa33a9d9074f4424a3851478935ff33..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/1.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/2.png b/zh-cn/application-dev/quick-start/figures/2.png deleted file mode 100755 index afdab82267fcd7d5eacae76eba500baa3bbecd40..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/2.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/3.png b/zh-cn/application-dev/quick-start/figures/3.png deleted file mode 100755 index 85345789b60927729e9243798fe122c64ca92687..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/3.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117475776.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117475776.png deleted file mode 100644 index e235ddff784187c8075f3ddc5cae45c86556b630..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117475776.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117635680.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117635680.png deleted file mode 100644 index a99dd0e5f433e4b458ff3c79eac82ecf21b2786f..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117635680.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001118201202.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001118201202.png deleted file mode 100644 index 13231431d0fa268058df97a0187837c634052fa6..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001118201202.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144765960.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144765960.png deleted file mode 100644 index 8aac40ccf2d2dc3d22ee6e652ad4ba8ba45e71a2..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144765960.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001163835553.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001163835553.png deleted file mode 100644 index 93f3c6cdd75a7358060f9fc406921d43cac52c39..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001163835553.png and /dev/null differ diff --git "a/zh-cn/application-dev/quick-start/figures/\351\241\271\347\233\256\345\210\227\350\241\250.png" "b/zh-cn/application-dev/quick-start/figures/\351\241\271\347\233\256\345\210\227\350\241\250.png" deleted file mode 100755 index 43e80427f461dc0d19f5331773d94f6fb734b653..0000000000000000000000000000000000000000 Binary files "a/zh-cn/application-dev/quick-start/figures/\351\241\271\347\233\256\345\210\227\350\241\250.png" and /dev/null differ diff --git "a/zh-cn/application-dev/quick-start/\344\275\277\347\224\250JS\350\257\255\350\250\200\345\274\200\345\217\221.md" "b/zh-cn/application-dev/quick-start/\344\275\277\347\224\250JS\350\257\255\350\250\200\345\274\200\345\217\221.md" deleted file mode 100755 index b9d6d3bb9c983b7910feaee0c861817c9bdac781..0000000000000000000000000000000000000000 --- "a/zh-cn/application-dev/quick-start/\344\275\277\347\224\250JS\350\257\255\350\250\200\345\274\200\345\217\221.md" +++ /dev/null @@ -1,112 +0,0 @@ -# 使用JS语言开发 - -- [编写第一个页面](#section17436202895811) -- [创建另一个页面](#section944219415598) -- [实现页面跳转](#section126857614017) - -## 编写第一个页面 - -1. 第一个页面内有一个文本和一个按钮,通过text和button组件来实现。 - - 在“Project“窗口,选择“entry \> src \> main \> js \> default \> pages.index“,打开“index.hml“文件,添加一个文本和一个按钮,示例代码如下: - - ``` - -
- - - Hello World - - - -
- ``` - -2. 打开“index.css“文件,设置文本和按钮的样式,示例代码如下: - - ``` - /* index.css */ - .container { - flex-direction: column; /* 设置容器内的项目纵向排列 */ - justify-content: center; /* 设置项目位于容器主轴的中心 */ - align-items: center; /* 项目在交叉轴居中 */ - } - /* 对class="text"的组件设置样式 */ - .text{ - font-size: 42px; - } - /* 对class="button"的组件设置样式 */ - .button { - width: 240px; - height: 60px; - background-color: #007dff; - font-size: 30px; - text-color: white; - margin-top: 20px; - } - ``` - -3. 使用[预览器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/previewer-0000001054328973#ZH-CN_TOPIC_0000001056725592__section16523172216252)或[模拟器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/run_simulator-0000001053303709)运行项目,效果如下图所示: - - ![](figures/1.png) - - -## 创建另一个页面 - -1. 在“Project“窗口,打开“entry \> src \> main \> js \> default“,右键点击“pages.index“文件夹,选择“New \> JS Page“,命名为“details“,单击回车键。 - - 创建完成后,可以看到“pages.index“文件夹下的文件目录结构如: - - ![](figures/1-0.png) - -2. 打开“details.hml“文件,添加一个文本,示例代码如下: - - ``` - -
- - Hi there - -
- ``` - -3. 打开“details.css“文件,设置文本的样式,示例代码如下: - - ``` - /* details.css */ - .container { - flex-direction: column; - justify-content: center; - align-items: center; - } - .text { - font-size: 42px; - text-align: center; - } - ``` - - -## 实现页面跳转 - -1. 打开第一个页面的“index.js“文件,导入router模块,页面路由router根据页面的uri来找到目标页面,从而实现跳转。示例代码如下: - - ``` - // index.js - import router from '@system.router'; - - export default { - launch() { - router.push ({ - uri:'pages/index/details/details', // 指定要跳转的页面 - }) - } - } - ``` - -2. 再次使用[预览器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/previewer-0000001054328973#ZH-CN_TOPIC_0000001056725592__section16523172216252)或[模拟器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/run_simulator-0000001053303709)运行项目,效果如下图所示: - - ![](figures/2.png) - - -恭喜你,至此已成功完成HarmonyOS快速入门-使用JS语言开发。 - diff --git "a/zh-cn/application-dev/quick-start/\344\275\277\347\224\250\345\267\245\347\250\213\345\220\221\345\257\274\345\210\233\345\273\272\346\226\260\345\267\245\347\250\213.md" "b/zh-cn/application-dev/quick-start/\344\275\277\347\224\250\345\267\245\347\250\213\345\220\221\345\257\274\345\210\233\345\273\272\346\226\260\345\267\245\347\250\213.md" index 90a5aab67c6f2e9a6a74a5b5eb4d70933c36c3b4..c519201b80b810470920bf3025bdd4002c42046c 100644 --- "a/zh-cn/application-dev/quick-start/\344\275\277\347\224\250\345\267\245\347\250\213\345\220\221\345\257\274\345\210\233\345\273\272\346\226\260\345\267\245\347\250\213.md" +++ "b/zh-cn/application-dev/quick-start/\344\275\277\347\224\250\345\267\245\347\250\213\345\220\221\345\257\274\345\210\233\345\273\272\346\226\260\345\267\245\347\250\213.md" @@ -3,7 +3,7 @@ - [前提条件](#section13642104391619) - [操作步骤](#section132671712101714) -通过工程向导创建一个OpenHarmony工程,该功能只有DevEco Studio 2.2 Beta1及以上版本支持。如果是DevEco Studio 2.1 Release版本,请根据[通过导入Sample方式创建新工程](通过导入Sample方式创建新工程.md)进行操作。 +通过工程向导创建一个OpenHarmony工程,该功能只有DevEco Studio 2.2 Beta1及以上版本支持。如果是DevEco Studio 2.1 Release版本,请根据[使用导入Sample方式创建新工程](使用导入Sample方式创建新工程.md)进行操作。 ## 前提条件 diff --git "a/zh-cn/application-dev/quick-start/\345\237\272\344\272\216Native\347\232\204DataAbility\345\210\233\345\273\272\344\270\216\350\256\277\351\227\256.md" "b/zh-cn/application-dev/quick-start/\345\237\272\344\272\216Native\347\232\204DataAbility\345\210\233\345\273\272\344\270\216\350\256\277\351\227\256.md" index 6a2f10ea98521042c7a0728d03cd2f93fddf01ab..a55fc036ea24b92dcc952773468c7a2aab11eeda 100644 --- "a/zh-cn/application-dev/quick-start/\345\237\272\344\272\216Native\347\232\204DataAbility\345\210\233\345\273\272\344\270\216\350\256\277\351\227\256.md" +++ "b/zh-cn/application-dev/quick-start/\345\237\272\344\272\216Native\347\232\204DataAbility\345\210\233\345\273\272\344\270\216\350\256\277\351\227\256.md" @@ -1,10 +1,10 @@ # 基于Native的Data Ability创建与访问 -- **[Data Ability基本概念](#section001)** +- **[Data Ability基本概念](#Data Ability基本概念)** -- **[创建Data](#section002)** +- **[创建Data](#创建Data)** -- **[访问Data](#section003)** +- **[访问Data](#访问Data)** ## Data Ability基本概念 通过Ability派生出的DataAbility类(以下简称“Data”),有助于应用管理其自身和其他应用存储数据的访问,并提供与其他应用共享数据的方法。Data既可用于同设备不同应用的数据共享,也支持跨设备不同应用的数据共享。 diff --git "a/zh-cn/application-dev/quick-start/\345\274\200\345\217\221\345\207\206\345\244\207.md" "b/zh-cn/application-dev/quick-start/\345\274\200\345\217\221\345\207\206\345\244\207.md" deleted file mode 100755 index 5c358a3afe92b1225314361b96d635c9070fb6e5..0000000000000000000000000000000000000000 --- "a/zh-cn/application-dev/quick-start/\345\274\200\345\217\221\345\207\206\345\244\207.md" +++ /dev/null @@ -1,25 +0,0 @@ -# 开发准备 - -- [任务说明](#section2073881513322) -- [开发准备](#section11843205017326) - -## 任务说明 - -本文档适用于OpenHarmony应用开发的初学者。通过构建一个简单的具有页面跳转功能的应用(如下图[预览器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/previewer-0000001054328973#ZH-CN_TOPIC_0000001056725592__section16523172216252)运行效果所示),熟悉OpenHarmony应用开发流程。 - -为确保运行效果,请使用最新版本的**DevEco Studio**完成本任务,点击[此处](https://developer.harmonyos.com/cn/develop/deveco-studio#download)获取下载链接。 - -![](figures/3.png) - -另外,DevEco Studio V2.2 Beta1及更高版本还支持HarmonyOS低代码开发方式。低代码开发方式遵循[HarmonyOS JS开发规范](https://developer.harmonyos.com/cn/docs/documentation/doc-references/js-apis-overview-0000001056361791),具有丰富的UI界面编辑功能,通过可视化界面开发方式快速构建布局,可有效降低用户的上手成本提升用户构建UI界面的效率。 - -## 开发准备 - -1. 开始前请参考[配置OpenHarmony SDK](../quick-start/配置OpenHarmony-SDK.md),完成**DevEco Studio**的安装和开发环境配置。 -2. 开发环境配置完成后,请参考[创建和运行Hello World](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/hello_world-0000001054516888)创建工程,设备类型以“Phone“为例: - - 使用JS语言开发,模板选择“Empty Ability\(JS\)“ - -3. 工程创建完成后,使用[预览器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/previewer-0000001054328973#ZH-CN_TOPIC_0000001056725592__section16523172216252)或Phone[模拟器](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/run_simulator-0000001053303709)运行该工程。 - -完成上述操作后,请参考[使用JS语言开发](使用JS语言开发.md)继续下一步的学习。 - diff --git "a/zh-cn/application-dev/quick-start/\345\277\253\351\200\237\345\205\245\351\227\250.md" "b/zh-cn/application-dev/quick-start/\345\277\253\351\200\237\345\205\245\351\227\250.md" deleted file mode 100755 index a48a63e4740e2153845dd7964cfa50e98f0e9cec..0000000000000000000000000000000000000000 --- "a/zh-cn/application-dev/quick-start/\345\277\253\351\200\237\345\205\245\351\227\250.md" +++ /dev/null @@ -1,7 +0,0 @@ -# 快速入门 - -- **[开发准备](开发准备.md)** - -- **[使用JS语言开发](使用JS语言开发.md)** - - diff --git "a/zh-cn/application-dev/quick-start/\346\246\202\350\277\260.md" "b/zh-cn/application-dev/quick-start/\346\246\202\350\277\260.md" index 4726ab655e4b85c94c65e969bb0f674ede355e2d..e03d6668c8bcd34d3812937ad164111124c2474f 100644 --- "a/zh-cn/application-dev/quick-start/\346\246\202\350\277\260.md" +++ "b/zh-cn/application-dev/quick-start/\346\246\202\350\277\260.md" @@ -11,7 +11,7 @@ DevEco Studio是HarmonyOS的配套的开发IDE,因为HarmonyOS是基于OpenHar 使用DevEco Studio开发OpenHarmony应用的流程与开发HarmonyOS的流程完全一样,本文档仅描述OpenHarmony应用开发与HarmonyOS应用开发的差异点。 - **搭建开发环境差异**:OpenHarmony应用开发环境需要开发者手动配置SDK,具体可参考[配置OpenHarmony SDK](配置OpenHarmony-SDK.md)章节。 -- **导入OpenHarmony工程**:OpenHarmony应用开发,只能通过导入Sample工程的方式来创建一个新工程,具体可参考[导入OpenHarmony工程](导入OpenHarmony工程.md)。 +- **导入OpenHarmony工程**:OpenHarmony应用开发,只能通过导入Sample工程的方式来创建一个新工程,具体可参考[导入OpenHarmony工程](使用导入Sample方式创建新工程.md)。 - **调试签名配置**:OpenHarmony应用运行在真机设备上,需要对应用进行签名,关于OpenHarmony应用的签名指导请参考[配置OpenHarmony应用签名信息](配置OpenHarmony应用签名信息.md)。 - **在真机设备上运行应用**:需要使用hdc工具将OpenHarmony的hap包推送到真机设备上进行安装,具体可参考[安装运行OpenHarmony应用](安装运行OpenHarmony应用.md)。