未验证 提交 569e4ccf 编写于 作者: O openharmony_ci 提交者: Gitee

!16693 翻译已完成16109+15964

Merge pull request !16693 from shawn_he/16109-d
...@@ -89,8 +89,3 @@ httpRequest.request( ...@@ -89,8 +89,3 @@ httpRequest.request(
} }
); );
``` ```
## Samples
The following sample is provided to help you better understand how to develop the HTTP data request feature:
- [`HTTP`: Data Request (ArkTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Connectivity/Http)
- [HTTP Communication (ArkTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NetworkManagement/SmartChatEtsOH)
# IPC & RPC Development Guidelines # IPC & RPC Development
## When to Use ## When to Use
......
...@@ -63,7 +63,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen ...@@ -63,7 +63,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen
}); });
// Call startSharing to start network sharing of the specified type. // Call startSharing to start network sharing of the specified type.
sharing.startSharing(SharingIfaceType.SHARING_WIFI, (error) => { sharing.startSharing(sharing.SharingIfaceType.SHARING_WIFI, (error) => {
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
}); });
``` ```
...@@ -88,7 +88,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen ...@@ -88,7 +88,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen
}); });
// Call stopSharing to stop network sharing of the specified type. // Call stopSharing to stop network sharing of the specified type.
sharing.stopSharing(SharingIfaceType.SHARING_WIFI, (error) => { sharing.stopSharing(sharing.SharingIfaceType.SHARING_WIFI, (error) => {
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
}); });
``` ```
...@@ -107,7 +107,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen ...@@ -107,7 +107,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen
import sharing from '@ohos.net.sharing' import sharing from '@ohos.net.sharing'
// Call startSharing to start network sharing of the specified type. // Call startSharing to start network sharing of the specified type.
sharing.startSharing(SharingIfaceType.SHARING_WIFI, (error) => { sharing.startSharing(sharing.SharingIfaceType.SHARING_WIFI, (error) => {
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
}); });
...@@ -118,7 +118,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen ...@@ -118,7 +118,7 @@ For the complete list of APIs and example code, see [Network Sharing](../referen
}); });
// Call stopSharing to stop network sharing of the specified type and clear the data volume of network sharing. // Call stopSharing to stop network sharing of the specified type and clear the data volume of network sharing.
sharing.stopSharing(SharingIfaceType.SHARING_WIFI, (error) => { sharing.stopSharing(sharing.SharingIfaceType.SHARING_WIFI, (error) => {
console.log(JSON.stringify(error)); console.log(JSON.stringify(error));
}); });
......
...@@ -319,10 +319,3 @@ TLS Socket connection process on the client: ...@@ -319,10 +319,3 @@ TLS Socket connection process on the client:
tlsTwoWay.off('close'); tlsTwoWay.off('close');
}); });
``` ```
## Samples
The following samples are provided to help you better understand how to develop Socket connection features:
- [`Socket`: Socket Connection (ArkTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/Network/Socket)
- [UDP Socket (ArkTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NetworkManagement/UdpDemoOH)
- [TCP Socket (ArkTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NetworkManagement/TcpSocketDemo)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
The **intl** module provides basic i18n capabilities, such as time and date formatting, number formatting, and string sorting, through the standard i18n APIs defined in ECMA 402. For more details about APIs and their usage, see [intl](../reference/apis/js-apis-intl.md). The **intl** module provides basic i18n capabilities, such as time and date formatting, number formatting, and string sorting, through the standard i18n APIs defined in ECMA 402. For more details about APIs and their usage, see [intl](../reference/apis/js-apis-intl.md).
The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities through supplementary interfaces that are not defined in ECMA 402. It works with the Intl module to provide a complete suite of I18N capabilities. The [i18n](../reference/apis/js-apis-i18n.md) module provides enhanced I18N capabilities through supplementary interfaces that are not defined in ECMA 402. It works with the Intl module to provide a complete suite of I18N capabilities.
## Setting Locale Information ## Setting Locale Information
...@@ -111,7 +111,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug ...@@ -111,7 +111,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
let dateTimeFormat = new Intl.DateTimeFormat(); let dateTimeFormat = new Intl.DateTimeFormat();
``` ```
Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions). Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions9).
```js ```js
let options = {dateStyle: "full", timeStyle: "full"}; let options = {dateStyle: "full", timeStyle: "full"};
...@@ -150,7 +150,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug ...@@ -150,7 +150,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
let resolvedOptions = dateTimeFormat.resolvedOptions(); // resolvedOptions = {"locale": "zh-CN", "calendar": "gregorian", "dateStyle":"full", "timeStyle":"full", "timeZone": "CST"} let resolvedOptions = dateTimeFormat.resolvedOptions(); // resolvedOptions = {"locale": "zh-CN", "calendar": "gregorian", "dateStyle":"full", "timeStyle":"full", "timeZone": "CST"}
``` ```
## Number Formatting ## Formatting Numbers
[NumberFormat](../reference/apis/js-apis-intl.md#numberformat) provides APIs to implement the number formatting specific to a locale. [NumberFormat](../reference/apis/js-apis-intl.md#numberformat) provides APIs to implement the number formatting specific to a locale.
...@@ -181,7 +181,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug ...@@ -181,7 +181,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
let numberFormat = new Intl.NumberFormat(); let numberFormat = new Intl.NumberFormat();
``` ```
Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md#numberoptions). Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md#numberoptions9).
```js ```js
let options = {compactDisplay: "short", notation: "compact"}; let options = {compactDisplay: "short", notation: "compact"};
...@@ -209,7 +209,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug ...@@ -209,7 +209,7 @@ The [I18N](i18n-guidelines.md) module provides enhanced I18N capabilities throug
let resolvedOptions = numberFormat.resolvedOptions(); // resolvedOptions = {"locale": "zh-CN", "compactDisplay": "short", "notation": "compact", "numberingSystem": "Latn"} let resolvedOptions = numberFormat.resolvedOptions(); // resolvedOptions = {"locale": "zh-CN", "compactDisplay": "short", "notation": "compact", "numberingSystem": "Latn"}
``` ```
## String Sorting ## Sorting Strings
Users in different regions have different requirements for string sorting. [Collator](../reference/apis/js-apis-intl.md#collator8) provides APIs to sort character strings specific to a locale. Users in different regions have different requirements for string sorting. [Collator](../reference/apis/js-apis-intl.md#collator8) provides APIs to sort character strings specific to a locale.
...@@ -317,7 +317,7 @@ According to grammars in certain languages, the singular or plural form of a nou ...@@ -317,7 +317,7 @@ According to grammars in certain languages, the singular or plural form of a nou
let categoryResult = pluralRules.select(number); // categoryResult = "other" let categoryResult = pluralRules.select(number); // categoryResult = "other"
``` ```
## Formatting Relative Time ## Formatting the Relative Time
[RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8) provides APIs to format the relative time for a specific locale. [RelativeTimeFormat](../reference/apis/js-apis-intl.md#relativetimeformat8) provides APIs to format the relative time for a specific locale.
...@@ -385,9 +385,3 @@ According to grammars in certain languages, the singular or plural form of a nou ...@@ -385,9 +385,3 @@ According to grammars in certain languages, the singular or plural form of a nou
let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"}); let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"});
let options = relativeTimeFormat.resolvedOptions(); // options = {"locale": "zh-CN", "style": "long", "numeric": "always", "numberingSystem": "latn"} let options = relativeTimeFormat.resolvedOptions(); // options = {"locale": "zh-CN", "style": "long", "numeric": "always", "numberingSystem": "latn"}
``` ```
## Samples
The following sample is provided to help you better understand how to develop internationalization capabilities:
-[`International`: Internationalization (ArkTS) (API9) (Full SDK)] (https://gitee.com/openharmony/applications_app_samples/tree/master/code/SystemFeature/Internationalnation/International)
# @ohos.net.http (Data Request) # @ohos.net.http (Data Request)
This module provides the HTTP data request capability. An application can initiate a data request over HTTP. Common HTTP methods include **GET**, **POST**, **OPTIONS**, **HEAD**, **PUT**, **DELETE**, **TRACE**, and **CONNECT**. The **http** module provides the HTTP data request capability. An application can initiate a data request over HTTP. Common HTTP methods include **GET**, **POST**, **OPTIONS**, **HEAD**, **PUT**, **DELETE**, **TRACE**, and **CONNECT**.
>**NOTE** >**NOTE**
> >
...@@ -13,7 +13,7 @@ This module provides the HTTP data request capability. An application can initia ...@@ -13,7 +13,7 @@ This module provides the HTTP data request capability. An application can initia
import http from '@ohos.net.http'; import http from '@ohos.net.http';
``` ```
## Example ## Examples
```js ```js
// Import the http namespace. // Import the http namespace.
...@@ -27,7 +27,7 @@ httpRequest.on('headersReceive', (header) => { ...@@ -27,7 +27,7 @@ httpRequest.on('headersReceive', (header) => {
console.info('header: ' + JSON.stringify(header)); console.info('header: ' + JSON.stringify(header));
}); });
httpRequest.request( httpRequest.request(
// Customize EXAMPLE_URL on your own. It is up to you whether to add parameters to the URL. // Customize EXAMPLE_URL in extraData on your own. It is up to you whether to add parameters to the URL.
"EXAMPLE_URL", "EXAMPLE_URL",
{ {
method: http.RequestMethod.POST, // Optional. The default value is http.RequestMethod.GET. method: http.RequestMethod.POST, // Optional. The default value is http.RequestMethod.GET.
...@@ -69,7 +69,7 @@ httpRequest.request( ...@@ -69,7 +69,7 @@ httpRequest.request(
createHttp(): HttpRequest createHttp(): HttpRequest
Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An HttpRequest object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an **HttpRequest** object for each HTTP request. Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An **HttpRequest** object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an **HttpRequest** object for each HTTP request.
**System capability**: SystemCapability.Communication.NetStack **System capability**: SystemCapability.Communication.NetStack
...@@ -231,7 +231,7 @@ httpRequest.request("EXAMPLE_URL", ...@@ -231,7 +231,7 @@ httpRequest.request("EXAMPLE_URL",
request(url: string, options? : HttpRequestOptions): Promise\<HttpResponse\> request(url: string, options? : HttpRequestOptions): Promise\<HttpResponse\>
Initiates an HTTP request to a given URL. This API uses a promise to return the result. Initiates an HTTP request containing specified options to a given URL. This API uses a promise to return the result.
>**NOTE** >**NOTE**
>This API supports only transfer of data not greater than 5 MB. >This API supports only transfer of data not greater than 5 MB.
...@@ -332,7 +332,7 @@ httpRequest.destroy(); ...@@ -332,7 +332,7 @@ httpRequest.destroy();
### request2<sup>10+</sup> ### request2<sup>10+</sup>
request2(url: string, callback: AsyncCallback\<void\>): void request2(url: string, callback: AsyncCallback\<number\>): void
Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response. Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
...@@ -345,7 +345,7 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback ...@@ -345,7 +345,7 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | ----------------------------------------------- | | -------- | ---------------------------------------------- | ---- | ----------------------------------------------- |
| url | string | Yes | URL for initiating an HTTP request. | | url | string | Yes | URL for initiating an HTTP request. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[number](#responsecode)\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -366,9 +366,9 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback ...@@ -366,9 +366,9 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback
**Example** **Example**
```js ```js
httpRequest.request2("EXAMPLE_URL", (err) => { httpRequest.request2("EXAMPLE_URL", (err, data) => {
if (!err) { if (!err) {
console.info("request2 OK!"); console.info("request2 OK! ResponseCode is " + JSON.stringify(data));
} else { } else {
console.info("request2 ERROR : err = " + JSON.stringify(err)); console.info("request2 ERROR : err = " + JSON.stringify(err));
} }
...@@ -377,7 +377,7 @@ httpRequest.request2("EXAMPLE_URL", (err) => { ...@@ -377,7 +377,7 @@ httpRequest.request2("EXAMPLE_URL", (err) => {
### request2<sup>10+</sup> ### request2<sup>10+</sup>
request2(url: string, options: HttpRequestOptions, callback: AsyncCallback\<void\>): void request2(url: string, options: HttpRequestOptions, callback: AsyncCallback\<number\>): void
Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response. Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
...@@ -391,7 +391,7 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback ...@@ -391,7 +391,7 @@ Initiates an HTTP request to a given URL. This API uses an asynchronous callback
| -------- | ---------------------------------------------- | ---- | ----------------------------------------------- | | -------- | ---------------------------------------------- | ---- | ----------------------------------------------- |
| url | string | Yes | URL for initiating an HTTP request. | | url | string | Yes | URL for initiating an HTTP request. |
| options | HttpRequestOptions | Yes | Request options. For details, see [HttpRequestOptions](#httprequestoptions).| | options | HttpRequestOptions | Yes | Request options. For details, see [HttpRequestOptions](#httprequestoptions).|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[number](#responsecode)\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -444,9 +444,9 @@ httpRequest.request2("EXAMPLE_URL", ...@@ -444,9 +444,9 @@ httpRequest.request2("EXAMPLE_URL",
}, },
readTimeout: 60000, readTimeout: 60000,
connectTimeout: 60000 connectTimeout: 60000
}, (err) => { }, (err, data) => {
if (!err) { if (!err) {
console.info("request2 OK!"); console.info("request2 OK! ResponseCode is " + JSON.stringify(data));
} else { } else {
console.info("request2 ERROR : err = " + JSON.stringify(err)); console.info("request2 ERROR : err = " + JSON.stringify(err));
} }
...@@ -454,7 +454,7 @@ httpRequest.request2("EXAMPLE_URL", ...@@ -454,7 +454,7 @@ httpRequest.request2("EXAMPLE_URL",
``` ```
### request2<sup>10+</sup> ### request2<sup>10+</sup>
request2(url: string, options? : HttpRequestOptions): Promise\<void\> request2(url: string, options? : HttpRequestOptions): Promise\<number\>
Initiates an HTTP request containing specified options to a given URL. This API uses a promise to return the result, which is a streaming response. Initiates an HTTP request containing specified options to a given URL. This API uses a promise to return the result, which is a streaming response.
...@@ -473,7 +473,7 @@ Initiates an HTTP request containing specified options to a given URL. This API ...@@ -473,7 +473,7 @@ Initiates an HTTP request containing specified options to a given URL. This API
| Type | Description | | Type | Description |
| :------------------------------------- | :-------------------------------- | | :------------------------------------- | :-------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<[number](#responsecode)\> | Promise used to return the result.|
**Error codes** **Error codes**
...@@ -526,8 +526,8 @@ let promise = httpRequest.request("EXAMPLE_URL", { ...@@ -526,8 +526,8 @@ let promise = httpRequest.request("EXAMPLE_URL", {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
}); });
promise.then(() => { promise.then((data) => {
console.info("request2 OK!"); console.info("request2 OK!" + JSON.stringify(data));
}).catch((err) => { }).catch((err) => {
console.info("request2 ERROR : err = " + JSON.stringify(err)); console.info("request2 ERROR : err = " + JSON.stringify(err));
}); });
...@@ -1007,7 +1007,7 @@ Disables the cache and deletes the data in it. This API uses a promise to return ...@@ -1007,7 +1007,7 @@ Disables the cache and deletes the data in it. This API uses a promise to return
| Type | Description | | Type | Description |
| --------------------------------- | ------------------------------------- | | --------------------------------- | ------------------------------------- |
| Promise\<void\> | Promise used to return the result.| | Promise\<void\> | Promise used to return the result.|
**Example** **Example**
......
# Socket Connection # # @ohos.net.socket (Socket Connection)
The **socket** module implements data transfer over TCPSocket, UDPSocket, WebSocket, and TLSSocket connections. The **socket** module implements data transfer over TCPSocket, UDPSocket, WebSocket, and TLSSocket connections.
...@@ -364,7 +364,7 @@ udp.bind({address: '192.168.xx.xxx', port: xxxx, family: 1}, err => { ...@@ -364,7 +364,7 @@ udp.bind({address: '192.168.xx.xxx', port: xxxx, family: 1}, err => {
setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback\<void\>): void setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback\<void\>): void
Sets other properties of the UDPSocket connection. This API uses an asynchronous callback to return the result. Sets other attributes of the UDPSocket connection. This API uses an asynchronous callback to return the result.
>**NOTE** >**NOTE**
>This API can be called only after **bind** is successfully called. >This API can be called only after **bind** is successfully called.
...@@ -418,7 +418,7 @@ udp.bind({address:'192.168.xx.xxx', port:xxxx, family:1}, err=> { ...@@ -418,7 +418,7 @@ udp.bind({address:'192.168.xx.xxx', port:xxxx, family:1}, err=> {
setExtraOptions(options: UDPExtraOptions): Promise\<void\> setExtraOptions(options: UDPExtraOptions): Promise\<void\>
Sets other properties of the UDPSocket connection. This API uses a promise to return the result. Sets other attributes of the UDPSocket connection. This API uses a promise to return the result.
>**NOTE** >**NOTE**
>This API can be called only after **bind** is successfully called. >This API can be called only after **bind** is successfully called.
...@@ -522,7 +522,7 @@ let callback = value =>{ ...@@ -522,7 +522,7 @@ let callback = value =>{
console.log("on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo); console.log("on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo);
} }
udp.on('message', callback); udp.on('message', callback);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
udp.off('message', callback); udp.off('message', callback);
udp.off('message'); udp.off('message');
``` ```
...@@ -582,14 +582,14 @@ let callback1 = () =>{ ...@@ -582,14 +582,14 @@ let callback1 = () =>{
console.log("on listening, success"); console.log("on listening, success");
} }
udp.on('listening', callback1); udp.on('listening', callback1);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
udp.off('listening', callback1); udp.off('listening', callback1);
udp.off('listening'); udp.off('listening');
let callback2 = () =>{ let callback2 = () =>{
console.log("on close, success"); console.log("on close, success");
} }
udp.on('close', callback2); udp.on('close', callback2);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
udp.off('close', callback2); udp.off('close', callback2);
udp.off('close'); udp.off('close');
``` ```
...@@ -646,7 +646,7 @@ let callback = err =>{ ...@@ -646,7 +646,7 @@ let callback = err =>{
console.log("on error, err:" + JSON.stringify(err)); console.log("on error, err:" + JSON.stringify(err));
} }
udp.on('error', callback); udp.on('error', callback);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
udp.off('error', callback); udp.off('error', callback);
udp.off('error'); udp.off('error');
``` ```
...@@ -1426,7 +1426,7 @@ let callback = value =>{ ...@@ -1426,7 +1426,7 @@ let callback = value =>{
console.log("on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo); console.log("on message, message:" + value.message + ", remoteInfo:" + value.remoteInfo);
} }
tcp.on('message', callback); tcp.on('message', callback);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
tcp.off('message', callback); tcp.off('message', callback);
tcp.off('message'); tcp.off('message');
``` ```
...@@ -1486,14 +1486,14 @@ let callback1 = () =>{ ...@@ -1486,14 +1486,14 @@ let callback1 = () =>{
console.log("on connect success"); console.log("on connect success");
} }
tcp.on('connect', callback1); tcp.on('connect', callback1);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
tcp.off('connect', callback1); tcp.off('connect', callback1);
tcp.off('connect'); tcp.off('connect');
let callback2 = () =>{ let callback2 = () =>{
console.log("on close success"); console.log("on close success");
} }
tcp.on('close', callback2); tcp.on('close', callback2);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
tcp.off('close', callback2); tcp.off('close', callback2);
tcp.off('close'); tcp.off('close');
``` ```
...@@ -1550,7 +1550,7 @@ let callback = err =>{ ...@@ -1550,7 +1550,7 @@ let callback = err =>{
console.log("on error, err:" + JSON.stringify(err)); console.log("on error, err:" + JSON.stringify(err));
} }
tcp.on('error', callback); tcp.on('error', callback);
// You can pass the **callback** of the **on** method to cancel listening for a certain type of callback. If you do not pass the **callback**, you will cancel listening for all callbacks. // You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
tcp.off('error', callback); tcp.off('error', callback);
tcp.off('error'); tcp.off('error');
``` ```
...@@ -2674,4 +2674,4 @@ Defines the certificate raw data. ...@@ -2674,4 +2674,4 @@ Defines the certificate raw data.
| Type | Description | | Type | Description |
| --------------------------------------------------------------------- | --------------------- | | --------------------------------------------------------------------- | --------------------- |
|[cryptoFramework.EncodingBlob](js-apis-cryptoFramework.md#datablob) | Data and encoding format of the certificate.| |[cert.EncodingBlob](js-apis-cert.md#datablob) | Data and encoding format of the certificate.|
...@@ -108,9 +108,3 @@ This permission is of the **system\_basic** level. Before applying for the permi ...@@ -108,9 +108,3 @@ This permission is of the **system\_basic** level. Before applying for the permi
console.log("call state change, data is:" + JSON.stringify(data)); console.log("call state change, data is:" + JSON.stringify(data));
}); });
``` ```
## Samples
The following sample is provided to help you better understand how to develop the call service:
- [Call](https://gitee.com/openharmony/applications_app_samples/tree/master/Telephony/Call)
...@@ -110,9 +110,3 @@ The Short Messaging Service (SMS) module provides basic SMS management functions ...@@ -110,9 +110,3 @@ The Short Messaging Service (SMS) module provides basic SMS management functions
} }
} }
``` ```
## Samples
The following sample is provided to help you better understand how to develop the SMS service:
- [SMS](https://gitee.com/openharmony/applications_app_samples/tree/master/Telephony/Message)
...@@ -26,15 +26,15 @@ Your feedback matters. Submit issues and leave as detailed information as possib ...@@ -26,15 +26,15 @@ Your feedback matters. Submit issues and leave as detailed information as possib
1. On the Gitee page, click the **Issues** tab. On the displayed page, click **New issue**. Then enter the issue title and issue details. 1. On the Gitee page, click the **Issues** tab. On the displayed page, click **New issue**. Then enter the issue title and issue details.
2. Click **New** to submit the issue. The Docs team will confirm the issue. 2. Click **New** to submit the issue. The Docs team will confirm the issue.
>![](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
>
> **How can I provide a high-quality issue?**
> >
>**How can I provide a high-quality issue?** > - Provide a clear description of the issue, including the missing, outdated, incorrect, or to-be-improved content.
> > - Explain the impact of this issue on users.
>- Provide a clear description of the issue, including the missing, outdated, incorrect, or to-be-improved content. > - Limit the scope of the given issue to a specific task. If multiple fields are involved, break the issue down into smaller ones. For example, "Documents need to be optimized" is a broad issue, whereas "XX development guide lacks introduction to step XXX" is specific and operable.
>- Explain the impact of this issue on users. > - Search the list of existing issues to see if any related or similar issues have been submitted.
>- Limit the scope of the given issue to a specific task. If multiple fields are involved, break the issue down into smaller ones. For example, "Documents need to be optimized" is a broad issue, whereas "XX development guide lacks introduction to step XXX" is specific and operable. > - If an issue is associated with another issue or a pull request (PR), you can use its full URL or the combination of the number sign (#) and PR number to reference it.
>- Search the list of existing issues to see if any related or similar issues have been submitted.
>- If an issue is associated with another issue or a pull request (PR), you can use its full URL or the combination of the number sign (#) and PR number to reference it.
### Editing Existing Documents ### Editing Existing Documents
......
...@@ -60,8 +60,8 @@ Pictures used in **OpenHarmony\_DOCUMENTS/docs/quick-start/writing-instructions ...@@ -60,8 +60,8 @@ Pictures used in **OpenHarmony\_DOCUMENTS/docs/quick-start/writing-instructions
Use relative paths to reference pictures in the document. Use relative paths to reference pictures in the document.
>![](public_sys-resources/icon-caution.gif) **CAUTION:** > **CAUTION**
>Use the original pictures to avoid intellectual property infringement risks. > Use the original pictures to avoid intellectual property infringement risks.
- Pictures are clear and complete. For example, a flowchart has a start and an end. - Pictures are clear and complete. For example, a flowchart has a start and an end.
- The graphics has clear logic and are provided with text descriptions. Do not separate the graphics from the text. - The graphics has clear logic and are provided with text descriptions. Do not separate the graphics from the text.
...@@ -69,9 +69,9 @@ Use relative paths to reference pictures in the document. ...@@ -69,9 +69,9 @@ Use relative paths to reference pictures in the document.
- The text on pictures should be Chinese in Chinese documents and English in English documents. - The text on pictures should be Chinese in Chinese documents and English in English documents.
- It is recommended that pictures be named based on the content. Using only a number is difficult for picture inheritance. - It is recommended that pictures be named based on the content. Using only a number is difficult for picture inheritance.
>![](public_sys-resources/icon-note.gif) **NOTE:** > **NOTE:**
>Reference: > Reference:
>!\[\]\(./pic/pic-standard.png\) > !\[\]\(./pic/pic-standard.png\)
If a self-made picture is used, refer to the following figure to configure the color. The format can be **png**, **jpg**, **gif**, and so on. If a self-made picture is used, refer to the following figure to configure the color. The format can be **png**, **jpg**, **gif**, and so on.
......
...@@ -195,9 +195,9 @@ The HCTest framework is used to support test cases developed with the C language ...@@ -195,9 +195,9 @@ The HCTest framework is used to support test cases developed with the C language
Test suites are built along with version build. The ACTS is built together with the debug version. Test suites are built along with version build. The ACTS is built together with the debug version.
>![](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
>The ACTS build middleware is a static library, which will be linked to the image. > The ACTS build middleware is a static library, which will be linked to the image.
### C-based Test Case Execution \(for the Mini System\) ### C-based Test Case Execution \(for the Mini System\)
...@@ -334,9 +334,9 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor ...@@ -334,9 +334,9 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
Test suites are built along with the version build. The ACTS is built together with the debug version. Test suites are built along with the version build. The ACTS is built together with the debug version.
>![](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
> >
>The ACTS for the small system is independently built to an executable file \(.bin\) and archived in the **suites\\acts** directory of the build result. > The ACTS for the small system is independently built to an executable file \(.bin\) and archived in the **suites\\acts** directory of the build result.
### C++-based Test Case Execution \(for Standard and Small Systems\) ### C++-based Test Case Execution \(for Standard and Small Systems\)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册