提交 fdf1b43c 编写于 作者: S shaoziyun

Merge branch 'OpenHarmony-3.2-Beta1' of gitee.com:shaoziyun/docs into OpenHarmony-3.2-Beta1

......@@ -204,7 +204,7 @@ You can obtain the distributed table name for a remote device based on the local
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
const STORE_CONFIG = {name: "rdbstore.db",}
data_rdb.getRdbStore(STORE_CONFIG, 1, function (err, rdbStore) {
rdbStore.executeSql(SQL_CREATE_TABLE)
rdbStore.executeSql(CREATE_TABLE_TEST)
console.info('create table done.')
})
```
......
......@@ -82,7 +82,7 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
```c++
FILE *wavFile_ = nullptr;
static void BuqqerQueueCallback (SLOHBufferQueueItf bufferQueueItf, void *pContext, SLuint32 size)
static void BufferQueueCallback (SLOHBufferQueueItf bufferQueueItf, void *pContext, SLuint32 size)
{
FILE *wavFile = (FILE *)pContext;
if (!feof(wavFile)) {
......@@ -98,7 +98,7 @@ To use OpenSL ES to develop the audio playback function in OpenHarmony, perform
// Set wavFile_ to the descriptor of the file to be played.
wavFile_ = fopen(path, "rb");
(*bufferQueueItf)->RegisterCallback(bufferQueueItf, BuqqerQueueCallback, wavFile_);
(*bufferQueueItf)->RegisterCallback(bufferQueueItf, BufferQueueCallback, wavFile_);
```
......
......@@ -15,7 +15,7 @@ You can develop applications or services in the low-code approach using either o
- Create a project that supports low-code development. This method is used as an example in this topic.
- In an existing project, create a .visual file for development.
- In an existing project, create a .visual file for development. For details, see [Creating a .visual File That Supports Low-Code Development](#building-the-second-page).
## Creating a Project That Supports Low-Code Development
......@@ -52,7 +52,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
Open the **index.visual** file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
![en-us_image_0000001233208980](figures/en-us_image_0000001233208980.gif)
![en-us_image_0000001233208980](figures/en-us_image_0000001233208980.gif)
2. Add a **Column** component and set its styles and attributes.<a name="add_container"></a>
......@@ -70,7 +70,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
Drag the **Button** component from the **UI Control** area to the canvas and then to a position under the **Text** component. In the **Attributes &amp; Styles** area on the right, click ![en-us_image_0000001277728577](figures/en-us_image_0000001277728577.png)**General** and set **Height** of the **Button** component to **40vp**. Click ![en-us_image_0000001277809337](figures/en-us_image_0000001277809337.png)**Feature** and set **Label** to **Next** and **FontSize** to **25fp**. Below is an illustration of the operations.
![en-us_image_0000001235732402](figures/en-us_image_0000001235732402.gif)
![en-us_image_0000001235732402](figures/en-us_image_0000001235732402.gif)
5. On the toolbar in the upper right corner of the editing window, click **Previewer** to open the Previewer.
......@@ -85,7 +85,7 @@ Add **Column**, **Text**, and **Button** components to the first page. A column
In the **Project** window, choose **entry** &gt; **src** &gt; **main** &gt; **ets** &gt; **MainAbility**, right-click the **pages** folder, choose **New** &gt; **Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
![en-us_image_0000001233368868](figures/en-us_image_0000001233368868.png)
![en-us_image_0000001233368868](figures/en-us_image_0000001233368868.png)
2. [Delete the existing template components from the canvas.](#delete_origin_content)
......
......@@ -13,7 +13,7 @@ You can develop applications or services in the low-code approach using either o
- Create a project that supports low-code development. This method is used as an example in this topic.
- In an existing project, create a Visual file for development.
- In an existing project, create a Visual file for development. For details, see [Creating a .visual File That Supports Low-Code Development](#building-the-second-page).
## Creating a Project That Supports Low-Code Development
......@@ -53,15 +53,15 @@ Add **Div**, **Text**, and **Button** components to the first page.
1. Delete the existing template components from the canvas.<a name= delete_origin_content></a>
Open the index.visual file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
Open the index.visual file, right-click the existing template components on the canvas, and choose **Delete** from the shortcut menu to delete them. Below is an illustration of the operations.
![en-us_image_0000001216600980](figures/en-us_image_0000001216600980.gif)
![en-us_image_0000001216600980](figures/en-us_image_0000001216600980.gif)
2. Add a **Div** component and set its styles and attributes.<a name = add_container></a>
Drag the **Div** component from the **UI Control** area to the canvas. In the **Attributes &amp; Styles** area on the right, click ![en-us_image_0000001260226691](figures/en-us_image_0000001260226691.png)**General** and set **Height** to **100%** so that the component fills the entire screen. Click ![en-us_image_0000001215226858](figures/en-us_image_0000001215226858.png)**Flex**, set **FlexDirection** to **column** so that the main axis of the component is vertical, and set both **JustifyContent** and **AlignItems** to **center** so that the child components of the **Div** component are centered along the main axis and cross axis. Below is an illustration of the operations.
![en-us_image_0000001216448880](figures/en-us_image_0000001216448880.gif)
![en-us_image_0000001216448880](figures/en-us_image_0000001216448880.gif)
3. Add a **Text** component.
......@@ -88,7 +88,7 @@ Open the index.visual file, right-click the existing template components on the
In the **Project** window, choose **entry** &gt; **src** &gt; **main** &gt; **js** &gt; **MainAbility**, right-click the **pages** folder, choose **New** &gt; **Visual**, name the page **second**, and click **Finish**. Below, you can see the structure of the **pages** folder.
![en-us_image_0000001223882030](figures/en-us_image_0000001223882030.png)
![en-us_image_0000001223882030](figures/en-us_image_0000001223882030.png)
2. [Delete the existing template components from the canvas.](#delete_origin_content)
......
# Pasteboard
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> **NOTE**<br>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
......@@ -48,9 +48,9 @@ Creates a **PasteData** object for plain text.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("content");
```
```js
var pasteData = pasteboard.createPlainTextData("content");
```
## pasteboard.createHtmlData<sup>7+</sup>
......@@ -75,10 +75,10 @@ Creates a **PasteData** object for HTML text.
**Example**
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var pasteData = pasteboard.createHtmlData(html);
```
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var pasteData = pasteboard.createHtmlData(html);
```
## pasteboard.createWantData<sup>7+</sup>
......@@ -103,13 +103,13 @@ Creates a **PasteData** object for Want text.
**Example**
```js
var object = {
```js
var object = {
bundleName: "com.example.aafwk.test",
abilityName: "com.example.aafwk.test.TwoAbility"
};
var pasteData = pasteboard.createWantData(object);
```
};
var pasteData = pasteboard.createWantData(object);
```
## pasteboard.createUriData<sup>7+</sup>
......@@ -134,9 +134,9 @@ Creates a **PasteData** object for URI text.
**Example**
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
```
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
```
## pasteboard.createPlainTextRecord<sup>7+</sup>
......@@ -161,9 +161,9 @@ Creates a **PasteDataRecord** object of the plain text type.
**Example**
```js
var record = pasteboard.createPlainTextRecord("hello");
```
```js
var record = pasteboard.createPlainTextRecord("hello");
```
## pasteboard.createHtmlTextRecord<sup>7+</sup>
......@@ -188,10 +188,10 @@ Creates a **PasteDataRecord** object of the HTML text type.
**Example**
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var record = pasteboard.createHtmlTextRecord(html);
```
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var record = pasteboard.createHtmlTextRecord(html);
```
## pasteboard.createWantRecord<sup>7+</sup>
......@@ -216,13 +216,13 @@ Creates a **PasteDataRecord** object of the Want text type.
**Example**
```js
var object = {
```js
var object = {
bundleName: "com.example.aafwk.test",
abilityName: "com.example.aafwk.test.TwoAbility"
};
var record = pasteboard.createWantRecord(object);
```
};
var record = pasteboard.createWantRecord(object);
```
## pasteboard.createUriRecord<sup>7+</sup>
......@@ -247,9 +247,9 @@ Creates a **PasteDataRecord** object of the URI text type.
**Example**
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
```
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
```
## PasteDataProperty<sup>7+</sup>
......@@ -301,14 +301,14 @@ Forcibly converts the content in this **PasteData** object to the plain text. Th
**Example**
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
record.convertToText().then((data) => {
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
record.convertToText().then((data) => {
console.info('convertToText success data : ' + JSON.stringify(data));
}).catch((error) => {
}).catch((error) => {
console.error('convertToText failed because ' + JSON.stringify(error));
});
```
});
```
### convertToText<sup>7+</sup>
......@@ -327,16 +327,16 @@ Forcibly converts the content in this **PasteData** object to the plain text. Th
**Example**
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
record.convertToText((err, data) => {
```js
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
record.convertToText((err, data) => {
if (err) {
console.error('convertToText failed because ' + JSON.stringify(err));
return;
}
console.info('convertToText success data : ' + JSON.stringify(data));
});
```
});
```
## PasteData
......@@ -366,10 +366,10 @@ Obtains the plain text of the primary record.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var plainText = pasteData.getPrimaryText();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var plainText = pasteData.getPrimaryText();
```
### getPrimaryHtml<sup>7+</sup>
......@@ -388,11 +388,11 @@ Obtains the HTML text of the primary record.
**Example**
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var pasteData = pasteboard.createHtmlData(html);
var htmlText = pasteData.getPrimaryHtml();
```
```js
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var pasteData = pasteboard.createHtmlData(html);
var htmlText = pasteData.getPrimaryHtml();
```
### getPrimaryWant<sup>7+</sup>
......@@ -411,14 +411,14 @@ Obtains the **Want** object of the primary record.
**Example**
```js
var object = {
```js
var object = {
bundleName: "com.example.aafwk.test",
abilityName: "com.example.aafwk.test.TwoAbility"
};
var pasteData = pasteboard.createWantData(object);
var want = pasteData.getPrimaryWant();
```
};
var pasteData = pasteboard.createWantData(object);
var want = pasteData.getPrimaryWant();
```
### getPrimaryUri<sup>7+</sup>
......@@ -437,10 +437,10 @@ Obtains the URI text of the primary record.
**Example**
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
var uri = pasteData.getPrimaryUri();
```
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
var uri = pasteData.getPrimaryUri();
```
### addTextRecord<sup>7+</sup>
......@@ -461,10 +461,10 @@ The pasteboard supports a maximum number of 128 data records.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
pasteData.addTextRecord("good");
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
pasteData.addTextRecord("good");
```
### addHtmlRecord<sup>7+</sup>
......@@ -485,11 +485,11 @@ The pasteboard supports a maximum number of 128 data records.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
pasteData.addHtmlRecord(html);
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
pasteData.addHtmlRecord(html);
```
### addWantRecord<sup>7+</sup>
......@@ -510,14 +510,14 @@ The pasteboard supports a maximum number of 128 data records.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var object = {
```js
var pasteData = pasteboard.createPlainTextData("hello");
var object = {
bundleName: "com.example.aafwk.test",
abilityName: "com.example.aafwk.test.TwoAbility"
};
pasteData.addWantRecord(object);
```
};
pasteData.addWantRecord(object);
```
### addUriRecord<sup>7+</sup>
......@@ -538,10 +538,10 @@ The pasteboard supports a maximum number of 128 data records.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
pasteData.addUriRecord("dataability:///com.example.myapplication1?user.txt");
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
pasteData.addUriRecord("dataability:///com.example.myapplication1?user.txt");
```
### addRecord<sup>7+</sup>
......@@ -562,14 +562,14 @@ The pasteboard supports a maximum number of 128 data records.
**Example**
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
var textRecord = pasteboard.createPlainTextRecord("hello");
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var htmlRecord = pasteboard.createHtmlTextRecord(html);
pasteData.addRecord(textRecord);
pasteData.addRecord(htmlRecord);
```
```js
var pasteData = pasteboard.createUriData("dataability:///com.example.myapplication1?user.txt");
var textRecord = pasteboard.createPlainTextRecord("hello");
var html = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<meta charset=\"utf-8\">\n" + "<title>HTML-PASTEBOARD_HTML</title>\n" + "</head>\n" + "<body>\n" + " <h1>HEAD</h1>\n" + " <p></p>\n" + "</body>\n" + "</html>";
var htmlRecord = pasteboard.createHtmlTextRecord(html);
pasteData.addRecord(textRecord);
pasteData.addRecord(htmlRecord);
```
### getMimeTypes<sup>7+</sup>
......@@ -588,10 +588,10 @@ Obtains **mimeTypes** in [PasteDataProperty](#pastedataproperty7) from this past
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var types = pasteData.getMimeTypes();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var types = pasteData.getMimeTypes();
```
### getPrimaryMimeType<sup>7+</sup>
......@@ -610,10 +610,10 @@ Obtains the data type of the primary record.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var type = pasteData.getPrimaryMimeType();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var type = pasteData.getPrimaryMimeType();
```
### getProperty<sup>7+</sup>
......@@ -632,10 +632,10 @@ Obtains the property description object.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var property = pasteData.getProperty();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var property = pasteData.getProperty();
```
### getRecordAt<sup>7+</sup>
......@@ -660,10 +660,10 @@ Obtains the record with the specified index.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var record = pasteData.getRecordAt(0);
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var record = pasteData.getRecordAt(0);
```
### getRecordCount<sup>7+</sup>
......@@ -682,10 +682,10 @@ Obtains the number of data records in this pasteboard.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var count = pasteData.getRecordCount();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var count = pasteData.getRecordCount();
```
### getTag<sup>7+</sup>
......@@ -704,10 +704,10 @@ Obtains the user-defined tag content. If the tag content is not set, null is ret
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var tag = pasteData.getTag();
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var tag = pasteData.getTag();
```
### hasMimeType<sup>7+</sup>
......@@ -732,10 +732,10 @@ Checks whether the content of this pasteboard contains the specified data type.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var hasType = pasteData.hasMimeType(pasteboard.MIMETYPE_TEXT_PLAIN);
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var hasType = pasteData.hasMimeType(pasteboard.MIMETYPE_TEXT_PLAIN);
```
### removeRecordAt<sup>7+</sup>
......@@ -760,10 +760,10 @@ Removes the data record with a specified index from this pasteboard.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var isRemove = pasteData.removeRecordAt(0);
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var isRemove = pasteData.removeRecordAt(0);
```
### replaceRecordAt<sup>7+</sup>
......@@ -789,11 +789,11 @@ Replaces the data record with a specified index in this pasteboard.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("hello");
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
var isReplace = pasteData.replaceRecordAt(0, record);
```
```js
var pasteData = pasteboard.createPlainTextData("hello");
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
var isReplace = pasteData.replaceRecordAt(0, record);
```
## pasteboard.getSystemPasteboard
......@@ -812,9 +812,9 @@ Obtains the system pasteboard.
**Example**
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
```
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
```
## SystemPasteboard
......@@ -843,17 +843,17 @@ Writes data to a pasteboard. This API uses an asynchronous callback to return th
**Example**
```js
var pasteData = pasteboard.createPlainTextData("content");
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.setPasteData(pasteData, (error, data) => {
```js
var pasteData = pasteboard.createPlainTextData("content");
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.setPasteData(pasteData, (error, data) => {
if (error) {
console.error('Failed to setPasteData. Cause: ' + error.message);
return;
}
console.info('setPasteData successfully.');
});
```
});
```
### setPasteData
......@@ -878,15 +878,15 @@ Writes data to a pasteboard. This API uses a promise to return the result.
**Example**
```js
var pasteData = pasteboard.createPlainTextData("content");
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.setPasteData(pasteData).then((data) => {
```js
var pasteData = pasteboard.createPlainTextData("content");
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.setPasteData(pasteData).then((data) => {
console.info('setPasteData success.');
}).catch((error) => {
}).catch((error) => {
console.error('Failed to setPasteData. Cause: ' + error.message);
});
```
});
```
### getPasteData
......@@ -905,16 +905,16 @@ Reads the system pasteboard content. This API uses an asynchronous callback to r
**Example**
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.getPasteData((error, pasteData) => {
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.getPasteData((error, pasteData) => {
if (error) {
console.error('Failed to getPasteData. Cause: ' + error.message);
return;
}
var text = pasteData.getPrimaryText();
});
```
});
```
### getPasteData
......@@ -933,14 +933,14 @@ Reads the system pasteboard content. This API uses a promise to return the resul
**Example**
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.getPasteData().then((pasteData) => {
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.getPasteData().then((pasteData) => {
var text = pasteData.getPrimaryText();
}).catch((error) => {
}).catch((error) => {
console.error('Failed to getPasteData. Cause: ' + error.message);
})
```
})
```
### on('update')<sup>7+</sup>
......@@ -960,18 +960,18 @@ Subscribes to the content change event of the system pasteboard. If the pasteboa
**Example**
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
var listener = ()=>{
```js
var systemPasteboard = pasteboard.getSystemPasteboard();
var listener = () => {
console.info('The system pasteboard has changed');
};
systemPasteboard.on('update', listener);
```
};
systemPasteboard.on('update', listener);
```
### off('update')<sup>7+</sup>
off(type: 'update', callback? : () =&gt;void ): void
off(type: 'update', callback?: () =&gt;void ): void
Unsubscribes from the system pasteboard content change event.
......@@ -986,9 +986,12 @@ Unsubscribes from the system pasteboard content change event.
**Example**
```js
systemPasteboard.off('update', listener);
```
```js
let listener = () => {
console.info('The system pasteboard has changed');
};
systemPasteboard.off('update', listener);
```
### hasPasteData<sup>7+</sup>
......@@ -1007,15 +1010,15 @@ Checks whether the system pasteboard contains content. This API uses an asynchro
**Example**
```js
systemPasteboard.hasPasteData((err, data) => {
```js
systemPasteboard.hasPasteData((err, data) => {
if (err) {
console.error('failed to hasPasteData because ' + JSON.stringify(err));
return;
}
console.info('success hasPasteData : ' + JSON.stringify(data));
});
```
});
```
### hasPasteData<sup>7+</sup>
......@@ -1059,15 +1062,15 @@ Clears the system pasteboard content. This API uses an asynchronous callback to
**Example**
```js
systemPasteboard.clear((err, data) => {
```js
systemPasteboard.clear((err, data) => {
if (err) {
console.error('failed to clear because ' + JSON.stringify(err));
return;
}
console.info('success clear');
});
```
});
```
### clear<sup>7+</sup>
......@@ -1086,10 +1089,10 @@ Clears the system pasteboard content. This API uses a promise to return the resu
**Example**
```js
systemPasteboard.clear().then((data) => {
```js
systemPasteboard.clear().then((data) => {
console.info('success clear');
}).catch((error) => {
}).catch((error) => {
console.error('failed to clear because ' + JSON.stringify(error));
});
```
\ No newline at end of file
});
```
# System Parameter
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
> - The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - This is a system API and cannot be called by third-party applications.
......@@ -203,9 +203,9 @@ try {
```
## parameter.set(key: string, def?: string)
## parameter.set
set(key: string, def?: string): Promise&lt;string&gt;
set(key: string, value: string): Promise&lt;void&gt;
Sets a value for the attribute with the specified key. This API uses a promise to return the result.
......@@ -222,7 +222,7 @@ Sets a value for the attribute with the specified key. This API uses a promise t
| Type| Description|
| -------- | -------- |
| Promise&lt;string&gt; | Promise used to return the execution result.|
| Promise&lt;void&gt; | Promise used to return the execution result.|
**Example**
......
# Setting the System Time
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
This module is used to set and obtain the current system date, time, and time zone.
> **NOTE**<br>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......@@ -189,7 +189,7 @@ Obtains the time elapsed since system start, excluding the deep sleep time. This
**Example**
```js
systemTime.getCurrentTime().then((data) => {
systemTime.getRealActiveTime().then((data) => {
console.log(`systemTime.getRealActiveTime success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.getRealActiveTime because ` + JSON.stringify(error));
......
# ImageAnimator
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**<br>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
The **&lt;ImageAnimator&gt;** component enables images to be played frame by frame. The list of images to be played can be configured, and the duration of each image can be configured.
The **\<ImageAnimator>** component enables images to be played frame by frame. The list of images to be played can be configured, and the duration of each image can be configured.
## Required Permissions
......@@ -15,7 +15,7 @@ None
## Child Components
None
Not supported
## APIs
......@@ -53,7 +53,7 @@ ImageAnimator()
## Events
| Name | Description |
| Name | Description |
| -------- | -------- | -------- |
| onStart() =&gt; void | Triggered when the animation starts to play. |
| onPause() =&gt; void | Triggered when the animation playback is paused. |
......@@ -78,6 +78,7 @@ struct ImageAnimatorExample {
ImageAnimator()
.images([
{
// The comment folder is at the same level as the pages folder.
src: '/comment/bg1.jpg',
duration: 500,
width: 325,
......
# Marquee
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
......@@ -15,7 +15,7 @@ None
## Child Components
None
Not supported
## APIs
......@@ -34,7 +34,7 @@ Marquee(value: { start: boolean, step?: number, loop?: number, fromStart?: boole
## Events
| Name| Description|
| Name| Description|
| -------- | -------- |
| onStart(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | Triggered when the marquee starts scrolling.|
| onBounce(callback:&nbsp;()&nbsp;=&gt;&nbsp;void) | Triggered when the marquee has reached the end.|
......
# Toggle
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
......@@ -12,7 +11,7 @@ None
## Child Components
None
Not supported
## APIs
......@@ -20,42 +19,43 @@ None
Toggle(options: { type: ToggleType, isOn?: boolean })
- Parameters
| Name | Type | Mandatory | Default Value | Description |
| Name| Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- |
| type | ToggleType | Yes | - | Type of the toggle. |
| isOn | boolean | No | false | Initial state of the toggle.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> If **isOn** is not set during component creation, the selected state can be retained during component reuse. If **isOn** is set, the selected state needs to be retained during component reuse after the selected state is recorded using an event method. |
| type | ToggleType | Yes| - | Type of the toggle.|
| isOn | boolean | No| false | Whether the toggle is turned on. The value **true** means that the toggle is turned on, and **false** means the opposite.|
- ToggleType enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| Checkbox | A checkbox is provided. The text setting of the child component does not take effect. If the text setting is required, you can place the **&lt;Text&gt;** component and the current component in the layout component. |
| Button | A button is provided. If the text setting is available, the corresponding text content is displayed inside the button. |
| Switch | A switch is provided. The text setting of the child component does not take effect. If the text setting is required, you can place the **&lt;Text&gt;** component and the current component in the layout component. |
| Checkbox | A checkbox is provided, where the **\<Text>** settings can take effect only when it is placed with the current component in a layout component.<br>> **NOTE**<br><br>> The default value of the universal attribute [padding](ts-universal-attributes-size.md) is as follows:<br>{<br>&nbsp;top: 14 vp,<br>&nbsp;right: 6 vp,<br>&nbsp;bottom: 14 vp,<br>&nbsp;left: 6 vp<br> } |
| Button | A button is provided. The set text string, if any, will be displayed inside the button.|
| Switch | A switch is provided, where the **\<Text>** settings can take effect only when it is placed with the current component in a layout component.<br>> **NOTE**<br><br>> The default value of the universal attribute [padding](ts-universal-attributes-size.md) is as follows:<br>{<br>&nbsp;top: 12 vp,<br>&nbsp;right: 12 vp,<br>&nbsp;bottom: 12 vp,<br>&nbsp;left: 12 vp<br> } |
## Attributes
| Name | Type | Default Value | Description |
| Name| Parameter| Default Value| Description|
| -------- | -------- | -------- | -------- |
| selectedColor | Color | - | Background color of the toggle when it is enabled. |
| switchPointColor | Color | - | Color of the circular slider of the **Switch** type.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> This attribute is valid only when type is set to **ToggleType.Switch**. |
| selectedColor | Color | - | Background color of the component when it is turned on.|
| switchPointColor | Color | - | Color of the circular slider when the component is of the **Switch** type.<br>> **NOTE**<br>> This attribute is valid only when **type** is set to **ToggleType.Switch**. |
## Events
| Name | Description |
| Name| Description|
| -------- | -------- |
| onChange(callback: (isOn: boolean) =&gt; void) | Triggered when the switch status changes. |
| onChange(callback:&nbsp;(isOn:&nbsp;boolean)&nbsp;=&gt;&nbsp;void) | Triggered when the toggle status changes.|
## Example
```
```ts
// xxx.ets
@Entry
@Component
struct ToggleExample {
build() {
Column({ space: 10 }) {
Text('type: Switch').fontSize(12).fontColor(0xcccccc).width('90%')
......
# XComponent
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<XComponent>** can accept and display the EGL/OpenGLES and media data input.
......@@ -19,10 +19,10 @@
- Name
| Name | Type | Mandatory| Description |
| ----------- | --------------------------------------------- | ---- | ------------------------------------------------------------ |
| Name | Type | Mandatory | Description |
| ----------- | --------------------------------------- | --------- | ------------------------------------------------------------ |
| id | string | Yes | Unique ID of the component. The value can contain a maximum of 128 characters. |
| type | string | Yes | Type of the component. The options are as follows:<br>-**surface**: The content of this component is displayed individually, without being combined with that of other components.<br>-**component**: The content of this component is displayed after having been combined with that of other components.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| type | string | Yes | Type of the component. The options are as follows:<br>- **surface**: The content of this component is displayed individually, without being combined with that of other components.<br>- **component**: The content of this component is displayed after having been combined with that of other components. |
| libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. |
| controller | [XComponentController](#XComponentController) | No | Controller bound to the component, which can be used to invoke methods of the component. |
......@@ -31,8 +31,8 @@
| Name | Description |
| ------------------------------- | ------------------------ |
| onLoad(context?: object) => void | Triggered when the plug-in is loaded.|
| onDestroy() => void | Triggered when the plug-in is destroyed.|
| onLoad(context?: object) => void | Triggered when the plug-in is loaded. |
| onDestroy() => void | Triggered when the plug-in is destroyed. |
## XComponentController
......@@ -54,7 +54,7 @@ Obtains the ID of the surface held by the **\<XComponent>**. The ID can be used
| Type | Description |
| ------ | --------------------------- |
| string | ID of the surface held by the **\<XComponent>**.|
| string | ID of the surface held by the **\<XComponent>**. |
### setXComponentSurfaceSize
......@@ -64,10 +64,10 @@ Sets the width and height of the surface held by the **\<XComponent>**.
- Parameters
| Name | Type| Mandatory| Default Value| Description |
| Name | Type | Mandatory | Default Value | Description |
| ------------- | -------- | ---- | ------ | ----------------------------- |
| surfaceWidth | number | Yes | - | Width of the surface held by the **\<XComponent>**.|
| surfaceHeight | number | Yes | - | Height of the surface held by the **\<XComponent>**.|
| surfaceWidth | number | Yes | - | Width of the surface held by the **\<XComponent>**. |
| surfaceHeight | number | Yes | - | Height of the surface held by the **\<XComponent>**. |
### getXComponentContext
......@@ -85,7 +85,8 @@ Obtains the context of an **\<XComponent>** object.
Provide a surface-type **\<XComponent>** to support capabilities such as camera preview.
```
```ts
// xxx.ets
import camera from '@ohos.multimedia.camera';
@Entry
@Component
......
# Image Effect Configuration
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> **NOTE**
> This attribute is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
......@@ -25,7 +25,7 @@ None
| invert | number | 0 | Inverts the input image. The input parameter is an image inversion ratio. The value **1** indicates complete inversion. The value **0** indicates that the image does not change. The unit is percentage. |
| colorBlend <sup>8+</sup> | Color | - | Adds the color blend effect to the current component. The input parameter is the blended color. |
| sepia | number | 0 | Converts the image color to sepia. The input parameter is an image inversion ratio. The value **1** indicates the image is completely sepia. The value **0** indicates that the image does not change. The unit is percentage. |
| hueRotate | Angle | 0deg | Adds the hue rotation effect to the current component. The input parameter is a rotation angle. If the input value is **0deg**, the image does not change (because the default rotation angle is **0deg**). The input parameter does not have the maximum value. If the value exceeds **360deg**, the image is rotated one ore more circles. |
| hueRotate | number \| string | '0deg' |Adds the hue rotation effect to the current component. The input parameter is a rotation angle. If the input value is **0deg**, the image does not change (because the default rotation angle is **0deg**). The input parameter does not have the maximum value. If the value exceeds **360deg**, the image is rotated for one more circle. In other words, the value **370deg** has the same effect as **10deg**.|
## Example
......
......@@ -28,7 +28,7 @@
- Running a Hello World Program
- Hi3861 Development Board
- [Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3861-application-framework.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3861-helloworld.md)
- [Building](quickstart-lite-steps-hi3861-building.md)
- [Burning](quickstart-lite-steps-hi3861-burn.md)
- [Networking](quickstart-lite-steps-hi3861-netconfig.md)
......@@ -36,7 +36,7 @@
- [Running](quickstart-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3516-application-framework.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3516-helloworld.md)
- [Building](quickstart-lite-steps-hi3516-building.md)
- [Burning](quickstart-lite-steps-hi3516-burn.md)
- [Running](quickstart-lite-steps-hi3516-running.md)
......@@ -75,7 +75,7 @@
- [Setting Up Environments for Standard System](quickstart-standard-env-setup.md)
- Running a Hello World Program
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-standard-running-hi3516-create.md)
- [Writing a Hello World Program](quickstart-std-3516-create.md)
- [Building](quickstart-standard-running-hi3516-build.md)
- [Burning](quickstart-standard-running-hi3516-burning.md)
- [Running](quickstart-standard-running-hi3516-running.md)
......
# Getting Started with Mini and Small Systems (Installation Package Mode)
- **[Mini and Small System Overview](quickstart-lite-overview.md)**
- **[Setting Up Environments for the Mini and Small Systems](quickstart-lite-env-setup.md)**
- **[Running a Hello World Program](quickstart-lite-steps.md)**
- **[FAQs](quickstart-lite-env-setup-faqs.md)**
- **[Appendix](quickstart-lite-appendix.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-ide-lite-board-introduction.md)**
# Introduction to Development Boards
- **[Introduction to the Hi3861 Development Board](quickstart-ide-lite-introduction-hi3861.md)**
- **[Introduction to the Hi3516 Development Board](quickstart-ide-lite-introduction-hi3516.md)**
# Creating a Source Code Project
# Importing a Source Code Project
After [setting up the Windows+Ubuntu hybrid development environment](../quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md) and [obtaining source code](../quick-start/quickstart-ide-lite-sourcecode-acquire.md), perform the following steps to create a source code project in Windows:
......@@ -15,7 +15,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. If you select to open the OpenHarmony source code, a message will be displayed indicating that the project is not a DevEco Device Tool project. Click **Import** to continue.
3. If this is the first time you import a project, a message will be displayed indicating that the project is not a DevEco Device Tool project. Click **Import** to continue.
![en-us_image_0000001135394334](figures/en-us_image_0000001135394334.png)
......
......@@ -11,15 +11,18 @@ In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 20.04 or later; recommended memory: 16 GB or higher.
- Ubuntu: Ubuntu 20.04 or later; recommended memory: 16 GB or higher
- User name: cannot contain Chinese characters
- User name (Ubuntu): cannot contain Chinese characters
- DevEco Device Tool: 3.0 Release
## Setting Up the Ubuntu Development Environment
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the Ubuntu system has not been set up yet, set it up on a virtual machine running Windows. Then, configure the Ubuntu basic environment.
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
......@@ -55,14 +58,15 @@ In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.401.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.401.sh
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
>
> During the installation, the page for agreeing to the user agreement and privacy statement is displayed. Read and agree to the user agreement and privacy statement.
>
> If this page is not displayed and the installation exits, run the apt-get install whiptail command, then the installation command.
Wait until the "Deveco Device Tool successfully installed." message is displayed.
![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png)
......@@ -76,7 +80,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool and click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
3. Set the installation path of DevEco Device Tool to a path that does not contain any Chinese characters, and then click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If you have installed DevEco Device Tool 3.0 Beta2 or earlier, the earlier version will be uninstalled before you install a new version. If the following error message is displayed during the uninstallation, click **Ignore** to continue the installation. This error does not affect the installation of the new version.
......@@ -101,11 +105,14 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
![en-us_image_0000001193983334](figures/en-us_image_0000001193983334.png)
5. In the dialog box shown below, click **Next** to download and install the tools..
5. In the dialog box shown below, click **Next**.
![en-us_image_0000001239634067](figures/en-us_image_0000001239634067.png)
6. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
6. Read the user agreement and privacy statement carefully, select I accept the licenses, and click **Next**.
![en-us_image_0000001307019009](figures/en-us_image_0000001307019009.png)
7. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001239650137](figures/en-us_image_0000001239650137.png)
......@@ -174,29 +181,9 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To eliminate the need for frequently entering the password for logging in to the remote computer, set an SSH public key.
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the .vscode-server folder on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
### Registering the Public Key for Accessing the Ubuntu Environment
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
```
![en-us_image_0000001271532317](figures/en-us_image_0000001271532317.png)
2. In Visual Studio Code, click the remote connection setting button and open the **config** file.
![en-us_image_0000001226034634](figures/en-us_image_0000001226034634.png)
3. In the **config** file, add the SSK key file information, as shown below. Then save the file.
![en-us_image_0000001270356233](figures/en-us_image_0000001270356233.png)
# Environment Preparation
- **[Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md)**
- **[Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md)**
......@@ -7,7 +7,7 @@ Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highl
**Figure 1** Hi3861 development board
![en-us_image_0000001226634692](figures/en-us_image_0000001226634692.png)
![en-us_image_0000001226634692](figures/en-us_image_0000001226634692.png)
The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
......
......@@ -10,7 +10,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
OpenHarmony also provides the [Docker environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Mini and Small Systems (Installation Package Mode)](../quick-start/quickstart-lite-overview.md).
......
......@@ -10,7 +10,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
2. Register an SSH public key for access to Gitee.
3. Install the git client and git-lfs.
3. Install the git client and git-lfs if they are unavailable.
Update the software source:
......@@ -70,9 +70,9 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).
## Running prebuilts
### Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
......
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3516D V300 supports burning through the USB port, network port, and serial port. This document describes how to burn source code through the USB port. The operations are performed in Windows.
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> If you are using the remote access mode (Windows + Ubuntu on the local VM), disable the USB control of the VM as follows to ensure that the development board is connected to the USB port of the host:
>
> - VMware: Configure the device to connect to the host under **Preferences** > **USB** and remove the USB controller from the VM settings.
>
> - VirtualBox: Deselect **Enable USB Controller** in the USB device options under Ubuntu settings.
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
2. If your computer does not have the USB port driver or USB-to-serial driver, install it by following the instructions in [Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board) or [Installing the Serial Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695), depending on the missing driver.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
4. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
![en-us_image_0000001216516128](figures/en-us_image_0000001216516128.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the serial port number is not displayed correctly, follow the steps described in [Installing the Serial Port Driver on the Hi3516 or Hi3518 Series Development Boards](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695).
4. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
5. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
5. On the **hi3516dv300** tab page, set the burning options.
6. On the **hi3516dv300** tab page, set the burning options.
- **upload_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-usb**.
![en-us_image_0000001223190441](figures/en-us_image_0000001223190441.png)
6. Check the preset information of the files to be burnt and modify them when necessary. The files to be burnt include **fastboot**, **kernel**, **rootfs**, and **userfs**.
7. In **Partitions**, check the preset burning settings of the files to be burnt.
1. On the **hi3516dv300_fastboot** tab, select the items to be modified in **New Option**, such as **partition_bin**, **partition_addr**, and **partition_length**.
![en-us_image_0000001312778829](figures/en-us_image_0000001312778829.png)
![en-us_image_0000001198889702](figures/en-us_image_0000001198889702.png)
2. In **Partition Options**, modify the items selected in the preceding step.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
To modify the burning settings for a specific file, click ![en-us_image_0000001312898911](figures/en-us_image_0000001312898911.png) next to the file.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap.
![en-us_image_0000001243290907](figures/en-us_image_0000001243290907.png)
3. Follow the same procedure to modify the information about the **kernel**, **rootfs**, and **userfs** files.
7. When you finish modifying, click **Save** on the top.
![en-us_image_0000001312780249](figures/en-us_image_0000001312780249.png)
8. Go to **hi3516dv300** > **Upload** to start burning.
8. When you finish modifying, click **Save** on the top.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If this is the first time you burn source code to the Hi3516D V300 or Hi3518E V300 board, the message "not find the Devices" may be displayed. In this case, follow the steps in [Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393) and start burning again.
9. Go to **hi3516dv300** > **Upload** to transfer the files to be burnt from Ubuntu to Windows. When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning.
![en-us_image_0000001267231481](figures/en-us_image_0000001267231481.png)
![en-us_image_0000001266887264](figures/en-us_image_0000001266887264.png)
9. When the following information is displayed in the Terminal window, press and hold the reset button, remove and insert the USB cable, and release the reset button to start burning.
10. When the following information is displayed in the **TERMINAL** window, press and hold the reset button within 15 seconds, remove and insert the USB cable, and release the reset button to start burning.
![en-us_image_0000001114129426](figures/en-us_image_0000001114129426.png)
......@@ -67,4 +65,4 @@ Hi3516D V300 supports burning through the USB port, network port, and serial por
![en-us_image_0000001160649343](figures/en-us_image_0000001160649343.png)
10. When the burning is successful, perform the operations in Running an Image to start the system.
11. When the burning is successful, perform the operations in Running to start the system.
......@@ -48,4 +48,4 @@ After the system is started, perform the following steps to run the Hello World
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-camera.md) to better familiarize yourself with OpenHarmony development.
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](../guide/device-camera-control-overview.md) to better familiarize yourself with OpenHarmony development.
# Hi3516 Development Board
- **[Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.md)**
- **[Building](quickstart-ide-lite-steps-hi3516-building.md)**
- **[Burning](quickstart-ide-lite-steps-hi3516-burn.md)**
- **[Running](quickstart-ide-lite-steps-hi3516-running.md)**
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3861 V100 supports burning through the serial port. To burn source code through the serial port in Windows, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
2. If your computer does not have the USB-to-serial driver, install it by following the instructions in [Installing the Serial Port Driver on Hi3861 V100](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
......@@ -16,18 +19,17 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
4. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
![en-us_image_0000001216274840](figures/en-us_image_0000001216274840.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the serial port number is not displayed correctly, follow the steps described in [Installing the Serial Port Driver on Hi3861 V100](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
4. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
5. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198943768](figures/en-us_image_0000001198943768.png)
5. On the **hi3861** tab page, set the burning options.
6. On the **hi3861** tab page, set the burning options.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-serial**.
......@@ -35,22 +37,24 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
![en-us_image_0000001243704061](figures/en-us_image_0000001243704061.png)
6. Check the preset information of the files to be burnt and modify them when necessary.
7. In **Partitions**, check the preset burning settings of the files to be burnt.
![en-us_image_000000131299335](figures/en-us_image_000000131299335.png)
On the **hi3861_app** tab page, select **partition_bin** from **New Option**, and set the path of the file to be burnt.
To modify the burning settings for a specific file, click ![en-us_image_0000001312898911](figures/en-us_image_0000001312898911.png) next to the file.
![en-us_image_0000001260919759](figures/en-us_image_0000001260919759.png)
![en-us_image_0000001312912501](figures/en-us_image_0000001312912501.png)
7. When you finish modifying, click **Save** on the top.
8. When you finish modifying, click **Save** on the top.
8. Click **Open** to open the project file. Then, choose **PROJECT TASKS** > **hi3861** > **Upload** to start burning.
9. Click **Open** to open the project file. Then, choose **PROJECT TASKS** > **hi3861** > **Upload** to start burning.
![en-us_image_0000001216440138](figures/en-us_image_0000001216440138.png)
9. When the following information is displayed, press the RST button on the development board to restart it.
10. When the following information is displayed, press the RST button on the development board within 15 seconds to restart it.
![en-us_image_0000001198466090](figures/en-us_image_0000001198466090.png)
10. Wait until the burning is complete. When the following message is displayed, the burning is successful.
When the following message is displayed, the burning is successful.
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
\ No newline at end of file
# Hi3861 Development Board
- **[Writing a Hello World Program](quickstart-ide-lite-steps-hi3861-application-framework.md)**
- **[Building](quickstart-ide-lite-steps-hi3861-building.md)**
- **[Burning](quickstart-ide-lite-steps-hi3861-burn.md)**
- **[Networking](quickstart-ide-lite-steps-hi3861-netconfig.md)**
- **[Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md)**
- **[Running](quickstart-ide-lite-steps-hi3861-running.md)**
# Running a Hello World Program
- **[Hi3861 Development Board](quickstart-ide-lite-steps-hi3861.md)**
- **[Hi3516 Development Board](quickstart-ide-lite-steps-hi3516.md)**
# Getting Started with Mini and Small Systems (IDE Mode)
- **[Mini and Small System Overview](quickstart-ide-lite-overview.md)**
- **[Environment Preparation](quickstart-ide-lite-env-setup.md)**
- **[Creating a Source Code Project](quickstart-ide-lite-create-project.md)**
- **[Running a Hello World Program](quickstart-ide-lite-steps.md)**
- **[Appendix](quickstart-ide-lite-appendix.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-ide-standard-board-introduction.md)**
# Introduction to Development Boards
- **[Introduction to the Hi3516 Development Board](quickstart-ide-standard-board-introduction-hi3516.md)**
- **[Introduction to the RK3568 Development Board](quickstart-ide-standard-board-introduction-rk3568.md)**
# Creating a Source Code Project
# Importing a Source Code Project
After [setting up the Windows+Ubuntu hybrid development environment](../quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md) and [obtaining source code](../quick-start/quickstart-ide-standard-sourcecode-acquire.md), perform the following steps to create a source code project in Windows:
......
# Environment Preparation
- **[Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md)**
- **[Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md)**
# Hi3516 Development Board
- **[Writing a Hello World Program](quickstart-ide-standard-running-hi3516-create.md)**
- **[Building](quickstart-ide-standard-running-hi3516-build.md)**
- **[Burning](quickstart-ide-standard-running-hi3516-burning.md)**
- **[Running](quickstart-ide-standard-running-hi3516-running.md)**
# RK3568 Development Board
- **[Writing a Hello World Program](quickstart-ide-standard-running-rk3568-create.md)**
- **[Building](quickstart-ide-standard-running-rk3568-build.md)**
- **[Burning](quickstart-ide-standard-running-rk3568-burning.md)**
- **[Running](quickstart-ide-standard-running-rk3568-running.md)**
# Running a Hello World Program
- **[Hi3516 Development Board](quickstart-ide-standard-running-hi3516.md)**
- **[RK3568 Development Board](quickstart-ide-standard-running-rk3568.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-lite-board-introduction.md)**
- **[Reference](quickstart-lite-reference.md)**
# Introduction to Development Boards
- **[Introduction to the Hi3861 Development Board](quickstart-lite-introduction-hi3861.md)**
- **[Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md)**
# FAQs
- **[Fixing hb Installation Issues](quickstart-lite-faq-hb.md)**
- **[Fixing Compilation Issues](quickstart-lite-faq-compose.md)**
- **[Fixing Burning Issues](quickstart-lite-faq-burning.md)**
# Burning
Hi3516D V300 supports burning through the USB port, network port, and serial port. This document describes how to burn source code through the USB port. The operations are performed in Windows.
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
### Importing Source Code
......
# Hi3516 Development Board
- **[Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md)**
- **[Writing a Hello World Program](quickstart-lite-steps-hi3516-application-framework.md)**
- **[Building](quickstart-lite-steps-hi3516-building.md)**
- **[Burning](quickstart-lite-steps-hi3516-burn.md)**
- **[Running](quickstart-lite-steps-hi3516-running.md)**
# Hi3861 Development Board
- **[Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md)**
- **[Writing a Hello World Program](quickstart-lite-steps-hi3861-application-framework.md)**
- **[Building](quickstart-lite-steps-hi3861-building.md)**
- **[Burning](quickstart-lite-steps-hi3861-burn.md)**
- **[Networking](quickstart-lite-steps-hi3861-netconfig.md)**
- **[Debugging and Verification](quickstart-lite-steps-hi3861-debug.md)**
- **[Running](quickstart-lite-steps-hi3861-running.md)**
# Running a Hello World Program
- **[Hi3861 Development Board](quickstart-lite-steps-hi3861.md)**
- **[Hi3516 Development Board](quickstart-lite-steps-hi3516.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-standard-board-introduction.md)**
- **[Reference](quickstart-standard-reference.md)**
# Introduction to Development Boards
- **[Introduction to the Hi3516 Development Board](quickstart-standard-board-introduction-hi3516.md)**
- **[Introduction to the RK3568 Development Board](quickstart-standard-board-introduction-rk3568.md)**
# Getting Started with Standard System (Using the Installation Package)
- **[Standard System Overview](quickstart-standard-overview.md)**
- **[Setting Up Environments for Standard System](quickstart-standard-env-setup.md)**
- **[Running a Hello World Project](quickstart-standard-running.md)**
- **[FAQs](quickstart-standard-faqs.md)**
- **[Appendix](quickstart-standard-appendix.md)**
# FAQs
- **[Fixing hb Installation Issues](quickstart-standard-faq-hb.md)**
- **[Fixing Compilation Issues](quickstart-standard-faq-compose.md)**
- **[Fixing Burning Issues](quickstart-standard-faq-burning.md)**
# Getting Started with Standard System (IDE Mode)
- **[Standard System Overview](quickstart-ide-standard-overview.md)**
- **[Environment Preparation](quickstart-ide-standard-env-setup.md)**
- **[Creating a Source Code Project](quickstart-ide-standard-create-project.md)**
- **[Running a Hello World Program](quickstart-ide-standard-running.md)**
- **[Appendix](quickstart-ide-standard-appendix.md)**
# Hi3516 Development Board
- **[Writing a Hello World Program](quickstart-standard-running-hi3516-create.md)**
- **[Building](quickstart-standard-running-hi3516-build.md)**
- **[Burning](quickstart-standard-running-hi3516-burning.md)**
- **[Running](quickstart-standard-running-hi3516-running.md)**
# RK3568 Development Board
- **[Writing a Hello World Program](quickstart-standard-running-rk3568-create.md)**
- **[Building](quickstart-standard-running-rk3568-build.md)**
- **[Burning](quickstart-standard-running-rk3568-burning.md)**
- **[Running](quickstart-standard-running-rk3568-running.md)**
# Running a Hello World Program
- **[Hi3516 Development Board](quickstart-standard-running-hi3516.md)**
- **[RK3568 Development Board](quickstart-standard-running-rk3568.md)**
# Getting Started
- **[Getting Started with Mini and Small Systems](quickstart-lite.md)**
- **[Getting Started with Standard System](quickstart-standard.md)**
......@@ -11,13 +11,13 @@
- [Obtaining Source Code](quick-start/quickstart-ide-lite-sourcecode-acquire.md)
- [Creating a Source Code Project](quick-start/quickstart-ide-lite-create-project.md)
- [Importing a Source Code Project](quick-start/quickstart-ide-lite-create-project.md)
- Running a Hello World Program
- Hi3861 Development Board
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3861-application-framework.md)
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3861-helloworld.md)
- [Building](quick-start/quickstart-ide-lite-steps-hi3861-building.md)
......@@ -31,7 +31,7 @@
- Hi3516 Development Board
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3516-application-framework.md)
- [Writing a Hello World Program](quick-start/quickstart-ide-lite-steps-hi3516-helloworld.md)
- [Building](quick-start/quickstart-ide-lite-steps-hi3516-building.md)
......@@ -57,7 +57,7 @@
- [Setting Up the Hi3861 Development Board Environment](quick-start/quickstart-lite-steps-hi3861-setting.md)
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3861-application-framework.md)
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3861-helloworld.md)
- [Building](quick-start/quickstart-lite-steps-hi3861-building.md)
......@@ -73,7 +73,7 @@
- [Setting Up the Hi3516 Development Board Environment](quick-start/quickstart-lite-steps-hi3516-setting.md)
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3516-application-framework.md)
- [Writing a Hello World Program](quick-start/quickstart-lite-steps-hi3516-helloworld.md)
- [Building](quick-start/quickstart-lite-steps-hi3516-building.md)
......@@ -109,7 +109,7 @@
- [Obtaining Source Code](quick-start/quickstart-ide-standard-sourcecode-acquire.md)
- [Creating a Source Code Project](quick-start/quickstart-ide-standard-create-project.md)
- [Importing a Source Code Project](quick-start/quickstart-ide-standard-create-project.md)
- Running a Hello World Program
......@@ -723,28 +723,24 @@
- Peripheral Driver Usage
- [Audio](driver/driver-peripherals-audio-des.md)
- [Camera](driver/driver-peripherals-camera-des.md)
- [Face_auth](driver/driver-peripherals-face_auth-des.md)
- [LCD](driver/driver-peripherals-lcd-des.md)
- [Touchscreen](driver/driver-peripherals-touch-des.md)
- [Light](driver/driver-peripherals-light-des.md)
- [Pin_auth](driver/driver-peripherals-pinauth-des.md)
- [Sensor](driver/driver-peripherals-sensor-des.md)
- [WLAN](driver/driver-peripherals-external-des.md)
- [Audio](driver/driver-peripherals-audio-des.md)
- [Touchscreen](driver/driver-peripherals-touch-des.md)
- [USB](driver/driver-peripherals-usb-des.md)
- [Camera](driver/driver-peripherals-camera-des.md)
- [User_auth](driver/driver-peripherals-user-auth-des.md)
- [Vibrator](driver/driver-peripherals-vibrator-des.md)
- [Light](driver/driver-peripherals-light-des.md)
- [WLAN](driver/driver-peripherals-external-des.md)
- Compilation and Building
- [Building Mini and Small Systems](subsystems/subsys-build-mini-lite.md)
- [Building the Standard System](subsystems/subsys-build-standard-large.md)
- [Build System Coding Specifications and Best Practices](subsystems/subsys-build-gn-coding-style-and-best-practice.md)
- [Building the Kconfig Visual Configuration](subsystems/subsys-build-gn-kconfig-visual-config-guide.md)
- [HAP Build Guide](subsystems/subsys-build-gn-hap-compilation-guide.md)
- [Distributed Remote Startup](subsystems/subsys-remote-start.md)
- Graphics
- [Graphics Overview](subsystems/subsys-graphics-overview.md)
......
......@@ -205,7 +205,7 @@
const CREATE_TABLE_TEST = "CREATE TABLE IF NOT EXISTS test (" + "id INTEGER PRIMARY KEY AUTOINCREMENT, " + "name TEXT NOT NULL, " + "age INTEGER, " + "salary REAL, " + "blobType BLOB)";
const STORE_CONFIG = {name: "rdbstore.db",}
data_rdb.getRdbStore(STORE_CONFIG, 1, function (err, rdbStore) {
rdbStore.executeSql(SQL_CREATE_TABLE)
rdbStore.executeSql(CREATE_TABLE_TEST)
console.info('create table done.')
})
```
......
# Context模块
Context模块提供了ability或application的上下文的能力,包括允许访问特定于应用程序的资源、请求和验证权限等并且只能通过ability获得。
> **说明:**
>
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# DataUriUtils模块
DataUriUtils模块提供用于处理使用DataAbilityHelper方案的对象的实用程序类的能力,包括获取,添加,更新给定uri的路径组件末尾的ID。
> **说明:**
>
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityContext
AbilityContext是Ability的上下文环境,继承自Context。
AbilityContext模块提供允许访问特定于ability的资源的能力,包括对Ability的启动、停止的设置、获取caller通信接口、拉起弹窗请求用户授权等。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
Ability的上下文环境,继承自Context。
## 导入模块
```js
......@@ -276,7 +278,7 @@ terminateSelf(): Promise&lt;void&gt;;
**示例:**
```js
this.context.terminateSelf(want).then((data) => {
this.context.terminateSelf().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
......
# ErrorCode
ErrorCode是定义启动功能时使用的错误代码。
本模块提供使用的错误代码的能力,包括没有错误,无效的参数等。
> **说明:**
>
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# wantConstant
wantConstant模块提供want中action和entity的权限列表的能力,包括系统公共事件宏,系统公共事件名称等。
> **说明:**
>
> 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityDelegatorRegistry
AbilityDelegatorRegistry模块提供用于存储已注册的AbilityDelegator和AbilityDelegatorArgs对象的全局寄存器的能力,包括获取应用程序的AbilityDelegator对象、获取单元测试参数AbilityDelegatorArgs对象。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityManager
AbilityManager模块提供对Ability相关信息和状态信息进行获取、新增、修改等能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口均为系统接口,三方应用不支持调用。
# 导入模块
```js
import AbilityManager from '@ohos.application.abilityManager'
```
## AbilityState
Ability的状态信息。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 值 | 说明 |
| -------- | -------- | -------- |
| INITIAL | 0 | 表示ability为initial状态。|
| FOREGROUND | 9 | 表示ability为foreground状态。 |
| BACKGROUND | 10 | 表示ability为background状态。 |
| FOREGROUNDING | 11 | 表示ability为foregrounding状态。 |
| BACKGROUNDING | 12 | 表示ability为backgrounding状态。 |
## updateConfiguration
updateConfiguration(config: Configuration, callback: AsyncCallback\<void>): void
通过修改配置来更新配置(callback形式)。
**需要权限**: ohos.permission.UPDATE_CONFIGURATION
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| config | Configuration | 是 | 新的配置项。 |
| callback | AsyncCallback\<void> | 是 | 被指定的回调方法。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
var config = {
language: 'chinese'
}
abilitymanager.updateConfiguration(config, () => {
console.log('------------ updateConfiguration -----------');
})
```
## updateConfiguration
updateConfiguration(config: Configuration): Promise\<void>
通过修改配置来更新配置(Promise形式)。
**需要权限**: ohos.permission.UPDATE_CONFIGURATION
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| config | Configuration | 是 | 新的配置项。 |
**返回值:**
| 类型 | 说明 |
| ---------------------------------------- | ------- |
| Promise\<void> | 返回执行结果。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
var config = {
language: 'chinese'
}
abilitymanager.updateConfiguration(config).then(() => {
console.log('updateConfiguration success');
}).catch((err) => {
console.log('updateConfiguration fail');
})
```
## getAbilityRunningInfos
getAbilityRunningInfos(callback: AsyncCallback\<Array\<AbilityRunningInfo>>): void
获取Ability运行相关信息(callback形式)。
**需要权限**: ohos.permission.GET_RUNNING_INFO
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| callback | AsyncCallback\<Array\<AbilityRunningInfo>> | 是 | 被指定的回调方法。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
abilitymanager.getAbilityRunningInfos((err,data) => {
console.log("getAbilityRunningInfos err: " + err + " data: " + JSON.stringify(data));
});
```
## getAbilityRunningInfos
getAbilityRunningInfos(): Promise\<Array\<AbilityRunningInfo>>
获取Ability运行相关信息(Promise形式)。
**需要权限**: ohos.permission.GET_RUNNING_INFO
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ---------------------------------------- | ------- |
| Promise\<Array\<AbilityRunningInfo>> | 返回执行结果。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
abilitymanager.getAbilityRunningInfos().then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data))
}).catch((err) => {
console.log("getAbilityRunningInfos err: " + err)
});
```
## getExtensionRunningInfos<sup>9+</sup>
getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\<Array\<ExtensionRunningInfo>>): void
获取关于运行扩展能力的信息(callback形式)。
**需要权限**: ohos.permission.GET_RUNNING_INFO
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| upperLimit | number | 是 | 获取消息数量的最大限制。 |
| callback | AsyncCallback\<Array\<AbilityRunningInfo>> | 是 | 被指定的回调方法。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
var upperLimit = 0;
abilitymanager.getExtensionRunningInfos(upperLimit, (err,data) => {
console.log("getExtensionRunningInfos err: " + err + " data: " + JSON.stringify(data));
});
```
## getExtensionRunningInfos<sup>9+</sup>
getExtensionRunningInfos(upperLimit: number): Promise\<Array\<ExtensionRunningInfo>>
获取关于运行扩展能力的信息(Promise形式)。
**需要权限**: ohos.permission.GET_RUNNING_INFO
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| upperLimit | number | 是 | 获取消息数量的最大限制。 |
**返回值:**
| 类型 | 说明 |
| ---------------------------------------- | ------- |
| Promise\<Array\<AbilityRunningInfo>> | 返回执行结果。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
var upperLimit = 0;
abilitymanager.getExtensionRunningInfos(upperLimit).then((data) => {
console.log("getAbilityRunningInfos data: " + JSON.stringify(data));
}).catch((err) => {
console.log("getAbilityRunningInfos err: " + err);
})
```
## getTopAbility<sup>9+</sup>
getTopAbility(callback: AsyncCallback\<ElementName>): void;
新增获取窗口焦点的ability接口(callback形式)。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**参数**
| 名称 | 类型 | 必填 | 描述 |
| --------- | ---------------------------------------- | ---- | -------------- |
| callback | AsyncCallback\<ElementName> | 是 | 被指定的回调方法。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
abilitymanager.getTopAbility((err,data) => {
console.log("getTopAbility err: " + err + " data: " + JSON.stringify(data));
});
```
## getTopAbility<sup>9+</sup>
getTopAbility(): Promise\<ElementName>;
新增获取窗口焦点的ability接口(Promise形式)。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
| 类型 | 说明 |
| ---------------------------------------- | ------- |
| Promise\<ElementName>| 返回执行结果。 |
**示例**
```js
import abilitymanager from '@ohos.application.abilityManager';
abilitymanager.getTopAbility().then((data) => {
console.log("getTopAbility data: " + JSON.stringify(data));
}).catch((err) => {
console.log("getTopAbility err: " + err);
})
```
\ No newline at end of file
# AbilityRunningInfo
AbilityRunningInfo模块提供对Ability运行的相关信息和状态进行设置和查询的能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
Ability运行相关信息。
## 导入模块
```js
......@@ -27,6 +27,8 @@ abilitymanager.getAbilityRunningInfos((err,data) => {
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| ability | ElementName | 是 | 否 | Ability匹配信息 |
......@@ -43,6 +45,8 @@ Ability的状态信息。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
| 名称 | 值 | 说明 |
| -------- | -------- | -------- |
| INITIAL | 0 | 表示ability为initial状态。|
......
# AbilityStageContext
AbilityStageContext是AbilityStage的上下文环境,继承自[Context](js-apis-application-context.md)
AbilityStageContext提供允许访问特定于abilityStage的资源的能力,包括获取AbilityStage对应的ModuleInfo对象、环境变化对象。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
AbilityStage的上下文环境,继承自[Context](js-apis-application-context.md)
## 导入模块
```js
......
# StartOptions
- [导入模块](#导入模块)
- [属性](#属性)
StartOptions模块对系统的基本通信组件进行查询和设置的能力。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
StartOptions是系统的基本通信组件。
## 导入模块
```
......@@ -18,7 +15,7 @@ import StartOptions from '@ohos.application.StartOptions';
## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.AbilityCore
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 可读 | 可写 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | -------- | -------- |
......
# Want
Want模块提供系统的基本通信组件的能力。
> **说明:**
>
> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
Want是系统的基本通信组件。
## 导入模块
```
......@@ -27,4 +27,4 @@ import Want from '@ohos.application.Want';
| action | 只读 | string | 否 | 表示action选项描述。 |
| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 |
| entities | 只读 | Array\<string> | 否 | 表示entities相关描述。 |
| moduleName<sup>9+</sup> | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。同一应用的不同hap的组件可能重名,仅通过BundleName和AbilityName无法区分时,可以通过设置moduleName加以区分,以匹配到指定的Ability。 | |
# Ability
Ability模块提供对Ability生命周期、上下文环境等调用管理的能力,包括Ability创建、销毁、转储客户端信息等。
该模块提供以下Ability相关的常用功能:
- [Caller](#caller):通用组件Caller通信客户端调用接口, 用来向通用组件服务端发送约定数据。
- [Callee](#callee):通用组件服务端注册和解除客户端caller通知送信的callback接口。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
Ability模块,提供对Ability生命周期、上下文环境等调用管理。
## 导入模块
```
......
# AbilityConstant
- [导入模块](#导入模块)
- [属性](#属性)
AbilityConstant是启动参数的接口。
AbilityConstant提供启动参数的接口的能力,包括设置初次开始原因的类型、上次退出原因的类型、继续结果的类型。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
启动参数的接口.
## 导入模块
```js
......
# AbilityDelegator
AbilityDelegator提供添加用于监视指定能力的生命周期状态更改的AbilityMonitor对象的能力,包括对AbilityMonitor实例的添加、删除、等待ability到达OnCreate生命周期、设置等待时间等、获取指定ability的生命周期状态、获取当前应用顶部ability、启动指定ability等。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityDelegatorArgs
AbilityDelegatorArgs模块提供在应用程序启动期间,用于存储已注册的AbilityDelegator和AbilityDelegatorArgs对象的全局寄存器的能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityLifecycleCallback
AbilityLifecycleCallback模块提供应用上下文ApplicationContext的生命周期监听方法的回调类的能力,包括onAbilityCreate、onAbilityWindowStageCreate、onAbilityWindowStageDestroy等方法。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
应用上下文ApplicationContext的生命周期监听方法的回调类,里面提供了onAbilityCreate、onAbilityWindowStageCreate、onAbilityWindowStageDestroy等方法。
## 导入模块
```js
......
# AbilityMonitor
AbilityMonitor模块提供匹配满足指定条件的受监视能力对象的方法的能力,最近匹配的能力对象将保存在AbilityMonitor对象中。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# AbilityStage
AbilityStage是HAP包的运行时类。
AbilityStage模块提供在HAP加载的时候,通知开发者,可以在此进行该HAP的初始化(如资源预加载,线程创建等)能力。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
AbilityStage是HAP包的运行时类。在HAP加载的时候,通知开发者,开发者可以在此进行该HAP的初始化(如资源预加载,线程创建等)。
## 导入模块
```js
......
# ApplicationContext
ApplicationContext模块提供开发者应用级别的的上下文的能力,包括提供注册及取消注册应用内组件生命周期的监听接口。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
提供开发者应用级别的的上下文,提供注册及取消注册应用内组件生命周期的监听接口。
## 导入模块
```
......@@ -45,10 +45,49 @@ registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): **number**
**示例:**
```js
import AbilityStage from "@ohos.application.AbilityStage";
var lifecycleid;
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let AbilityLifecycleCallback = {
onAbilityCreate(ability){
console.log("AbilityLifecycleCallback onAbilityCreate ability:" + JSON.stringify(ability));
},
onAbilityWindowStageCreate(ability){
console.log("AbilityLifecycleCallback onAbilityWindowStageCreate ability:" + JSON.stringify(ability));
},
onAbilityWindowStageDestroy(ability){
console.log("AbilityLifecycleCallback onAbilityWindowStageDestroy ability:" + JSON.stringify(ability));
},
onAbilityDestroy(ability){
console.log("AbilityLifecycleCallback onAbilityDestroy ability:" + JSON.stringify(ability));
},
onAbilityForeground(ability){
console.log("AbilityLifecycleCallback onAbilityForeground ability:" + JSON.stringify(ability));
},
onAbilityBackground(ability){
console.log("AbilityLifecycleCallback onAbilityBackground ability:" + JSON.stringify(ability));
},
onAbilityContinue(ability){
console.log("AbilityLifecycleCallback onAbilityContinue ability:" + JSON.stringify(ability));
}
}
// 1.通过context属性获取applicationContext
let applicationContext = this.context.getApplicationContext();
console.log("stage applicationContext: " + JSON.stringify(applicationContext));
let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback);
// 2.通过applicationContext注册监听应用内生命周期
lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback);
console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid));
}
onDestroy() {
let applicationContext = this.context.getApplicationContext();
applicationContext.unregisterAbilityLifecycleCallback(lifecycleid, (error, data) => {
console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error));
});
}
}
```
## ApplicationContext.unregisterAbilityLifecycleCallback
......@@ -70,6 +109,7 @@ unregisterAbilityLifecycleCallback(callbackId: **number**, callback: AsyncCallb
```js
let applicationContext = this.context.getApplicationContext();
let lifecycleid=1
console.log("stage applicationContext: " + JSON.stringify(applicationContext));
applicationContext.unregisterAbilityLifecycleCallback(lifecycleid, (error, data) => {
console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error));
......
# Context
Context模块提供开发者运行代码的上下文环境的能力,包括查询和设置应用信息、ResourceManager等信息。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# MissionInfo
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```js
import MissionInfo from '@ohos.application.missionInfo'
```
## MissionInfo
表示Ability对应任务信息的枚举。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| missionId | number | 是 | 是 | 表示任务ID。|
| runningState | number | 是 | 是 | 表示运行状态。 |
| lockedState | boolean | 是 | 是 | 表示锁定状态。 |
| timestamp | string | 是 | 是 | 表示任务的最近创建或更新时间。 |
| want | [Want](js-apis-application-Want.md) | 是 | 是 | 表示任务的Want信息。 |
| label | string | 是 | 是 | 表示任务的标签。 |
| iconPath | string | 是 | 是 | 表示任务的图标路径。 |
| continuable | boolean | 是 | 是 | 表示任务是否可以继续。 |
# ShellCmdResult
ShellCmdResult模块提供Shell命令执行结果的能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
# StaticSubscriberExtensionAbility
StaticSubscriberExtensionAbility模块提供静态订阅者扩展能力的类别的能力。
> **说明:**
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -16,7 +18,9 @@ onReceiveEvent(event: CommonEventData): void;
静态订阅者通用事件回调。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
**参数:**
......
# appManager
appManager模块提供服务功能的能力,包括查询当前是否处于稳定性测试场景、查询是否为ram受限设备、获取应用程序的内存大小、获取有关运行进程的信息等。
> **说明:**
>
> 本模块首批接口从API version 7 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
App管理。
## 导入模块
```js
import app from '@ohos.application.appManager';
```
## appManager.isRunningInStabilityTest<sup>8+</sup>
static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
......@@ -165,6 +163,8 @@ getProcessRunningInfos(): Promise<Array\<ProcessRunningInfo>>;
获取有关运行进程的信息。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
......@@ -189,6 +189,8 @@ getProcessRunningInfos(callback: AsyncCallback<Array\<ProcessRunningInfo>>): voi
获取有关运行进程的信息。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -212,7 +214,7 @@ getProcessRunningInfos(callback: AsyncCallback<Array\<ProcessRunningInfo>>): voi
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ |
| pid<sup>8+</sup> | 只读 | number | 否 | 进程ID。 |
| uid<sup>8+</sup> | 只读 | number | 否 | 用户ID。 |
| processName<sup>8+</sup> | 只读 | string | 否 | 进程的名称。 |
| bundleNames<sup>8+</sup> | 只读 | Array\<string> | 否 | 进程中运行的bundleName数组。 |
| pid<sup>9+</sup> | 只读 | number | 否 | 进程ID。 |
| uid<sup>9+</sup> | 只读 | number | 否 | 用户ID。 |
| processName<sup>9+</sup> | 只读 | string | 否 | 进程的名称。 |
| bundleNames<sup>9+</sup> | 只读 | Array\<string> | 否 | 进程中运行的bundleName数组。 |
# Configuration
Configuration模块提供环境变化信息的能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
环境变化信息。
## 导入模块
```js
......
# ConfigurationConstant
ConfigurationConstant模块提供配置信息枚举值定义的能力。
> **说明:**
>
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
配置信息枚举值定义。
## 导入模块
......@@ -15,7 +13,6 @@
import ConfigurationConstant from '@ohos.application.ConfigurationConstant';
```
## ConfigurationConstant.ColorMode
使用时通过ConfigurationConstant.ColorMode获取。
......
# EventHub
EventHub模块提供了事件中心,提供订阅、取消订阅、触发事件的能力。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
事件中心,提供订阅、取消订阅、触发事件能力。
## 导入模块
```js
......
# ExtensionContext
ExtensionContext是Extension的上下文环境,继承自Context。
ExtensionContext模块提供扩展的上下文的能力,包括允许访问特定于扩展的资源。
> **说明:**
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......@@ -8,11 +12,8 @@
## 导入模块
```js
import DataShareExtensionAbility from '@ohos.application.DataShareExtensionAbility';
import FormExtension from '@ohos.application.FormExtension';
```
## 使用说明
Extension的上下文环境,继承自Context。
## 属性
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册