提交 98672c9f 编写于 作者: Y yuyaozhi

Merge branch 'master' of https://gitee.com/yuyaozhi/docs

...@@ -45,8 +45,13 @@ ...@@ -45,8 +45,13 @@
- [SMS](js-apis-sms.md) - [SMS](js-apis-sms.md)
- [SIM Management](js-apis-sim.md) - [SIM Management](js-apis-sim.md)
- [Radio](js-apis-radio.md) - [Radio](js-apis-radio.md)
- [observer](js-apis-observer.md) - [Observer](js-apis-observer.md)
- [Cellular Data](js-apis-telephony-data.md) - [Cellular Data](js-apis-telephony-data.md)
- Network Management
- [Network Connection Management](js-apis-net-connection.md)
- [Socket Connection](js-apis-socket.md)
- [WebSocket Connection](js-apis-webSocket.md)
- [Data Request](js-apis-http.md)
- Network and Connectivity - Network and Connectivity
- [WLAN](js-apis-wifi.md) - [WLAN](js-apis-wifi.md)
- [Bluetooth](js-apis-bluetooth.md) - [Bluetooth](js-apis-bluetooth.md)
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
import call from '@ohos.telephony.call'; import call from '@ohos.telephony.call';
``` ```
## call.dial<a name=call.dial-callback1></a> ## call.dial
dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void dial\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void
Initiates a call. This function uses an asynchronous callback to return the execution result. Initiates a call. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required permission**: ohos.permission.PLACE\_CALL (a system permission)
...@@ -23,7 +23,7 @@ Initiates a call. This function uses an asynchronous callback to return the exec ...@@ -23,7 +23,7 @@ Initiates a call. This function uses an asynchronous callback to return the exec
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------- | | ----------- | ---------------------------- | ---- | ------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
...@@ -37,11 +37,11 @@ call.dial("138xxxxxxxx", (err, data) => { ...@@ -37,11 +37,11 @@ call.dial("138xxxxxxxx", (err, data) => {
``` ```
## call.dial<a name=call.dial-callback2></a> ## call.dial
dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean\>\): void dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback<boolean\>\): void
Initiates a call. You can set call options as needed. This function uses an asynchronous callback to return the execution result. Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the execution result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required permission**: ohos.permission.PLACE\_CALL (a system permission)
...@@ -49,10 +49,10 @@ Initiates a call. You can set call options as needed. This function uses an asyn ...@@ -49,10 +49,10 @@ Initiates a call. You can set call options as needed. This function uses an asyn
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------- | | ----------- | ---------------------------- | ---- | ------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions). | | options | DialOptions | Yes | Call options defined in [DialOptions](#dialoptions). |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: success<br>- **false**: failure|
**Example** **Example**
...@@ -66,11 +66,11 @@ call.dial("138xxxxxxxx", { ...@@ -66,11 +66,11 @@ call.dial("138xxxxxxxx", {
``` ```
## call.dial<a name=call.dial-promise></a> ## call.dial
dial\(phoneNumber: string, options?: DialOptions\): Promise<boolean\> dial\(phoneNumber: string, options?: DialOptions\): Promise<boolean\>
Initiates a call. You can set call options as needed. This function uses a promise to return the execution result. Initiates a call. You can set call options as needed. This API uses a promise to return the execution result.
**Required permission**: ohos.permission.PLACE\_CALL (a system permission) **Required permission**: ohos.permission.PLACE\_CALL (a system permission)
...@@ -78,10 +78,10 @@ Initiates a call. You can set call options as needed. This function uses a promi ...@@ -78,10 +78,10 @@ Initiates a call. You can set call options as needed. This function uses a promi
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ----------- | ---- | ------------------------------------------- | | ----------- | ----------- | ---- | ------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions).| | options | DialOptions | Yes | Call options defined in [DialOptions](#dialoptions).|
**Return Value** **Return Value**
...@@ -102,17 +102,19 @@ promise.then(data => { ...@@ -102,17 +102,19 @@ promise.then(data => {
}); });
``` ```
## call.makeCall<sup>7+</sup><a name=call.makeCall-callback></a> ## call.makeCall<sup>7+</sup>
makeCall(phoneNumber: string, callback: AsyncCallback<void>): void makeCall(phoneNumber: string, callback: AsyncCallback\<void\>): void
Launches the call screen and displays the dialed number. This method uses an asynchronous callback to return the result. Launches the call screen and displays the dialed number. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.
**System capability**: SystemCapability.Applications.Contacts
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------- | ---- | ------------------------------------------ | | ----------- | ------------------------- | ---- | ------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
...@@ -126,17 +128,19 @@ call.makeCall("138xxxxxxxx", err => { ...@@ -126,17 +128,19 @@ call.makeCall("138xxxxxxxx", err => {
``` ```
## call.makeCall<sup>7+</sup><a name=call.makeCall-promise></a> ## call.makeCall<sup>7+</sup>
makeCall(phoneNumber: string): Promise<void> makeCall(phoneNumber: string): Promise\<void\>
Launches the call screen and displays the dialed number. This method uses a promise to return the result. Launches the call screen and displays the dialed number. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.
**System capability**: SystemCapability.Applications.Contacts
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------- | | ----------- | ------ | ---- | ---------- |
| phoneNumber | string | Yes | Phone number.| | phoneNumber | string | Yes | Phone number.|
...@@ -157,17 +161,17 @@ promise.then(() => { ...@@ -157,17 +161,17 @@ promise.then(() => {
}); });
``` ```
## call.hasCall<a name=call.hasCall-callback></a> ## call.hasCall
hasCall\(callback: AsyncCallback<boolean\>\): void hasCall\(callback: AsyncCallback<boolean\>\): void
Checks whether a call is in progress. This function uses an asynchronous callback to return the result. Checks whether a call is in progress. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: A call is in progress.<br>- **false**: No call is in progress.|
...@@ -180,11 +184,11 @@ call.hasCall((err, data) => { ...@@ -180,11 +184,11 @@ call.hasCall((err, data) => {
``` ```
## call.hasCall<a name=call.hasCall-promise></a> ## call.hasCall
hasCall\(\): Promise<boolean\> hasCall\(\): Promise<boolean\>
Checks whether a call is in progress. This function uses a promise to return the result. Checks whether a call is in progress. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -206,19 +210,19 @@ promise.then(data => { ...@@ -206,19 +210,19 @@ promise.then(data => {
``` ```
## call.getCallState<a name=call.getCallState-callback></a> ## call.getCallState
getCallState\(callback: AsyncCallback<CallState\>\): void getCallState\(callback: AsyncCallback<CallState\>\): void
Obtains the call status. This function uses an asynchronous callback to return the result. Obtains the call status. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------------- | ---- | ------------------------------------ | | -------- | -------------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback&lt;[CallState](#CallState)&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;[CallState](#callstate)&gt; | Yes | Callback used to return the result.|
**Example** **Example**
...@@ -229,11 +233,11 @@ call.getCallState((err, data) => { ...@@ -229,11 +233,11 @@ call.getCallState((err, data) => {
``` ```
## call.getCallState<a name="call.getCallState-promise"></a> ## call.getCallState
getCallState\(\): Promise<CallState\> getCallState\(\): Promise<CallState\>
Obtains the call status. This function uses a promise to return the result. Obtains the call status. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -241,7 +245,7 @@ Obtains the call status. This function uses a promise to return the result. ...@@ -241,7 +245,7 @@ Obtains the call status. This function uses a promise to return the result.
| Type | Description | | Type | Description |
| -------------------------------------- | ----------------------------------------- | | -------------------------------------- | ----------------------------------------- |
| Promise&lt;[CallState](#CallState)&gt; | Promise used to return the result.| | Promise&lt;[CallState](#callstate)&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -254,11 +258,11 @@ promise.then(data => { ...@@ -254,11 +258,11 @@ promise.then(data => {
}); });
``` ```
## call.hasVoiceCapability<sup>7+</sup><a name=call.hasVoiceCapability></a> ## call.hasVoiceCapability<sup>7+</sup>
hasVoiceCapability(): boolean hasVoiceCapability(): boolean
Checks whether a device supports voice calls. This function works in synchronous mode. Checks whether a device supports voice calls. This API works in synchronous mode.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
...@@ -273,17 +277,17 @@ let result = call.hasVoiceCapability(); ...@@ -273,17 +277,17 @@ let result = call.hasVoiceCapability();
console.log(`hasVoiceCapability: ${JSON.stringify(result)}`); console.log(`hasVoiceCapability: ${JSON.stringify(result)}`);
``` ```
## call.isEmergencyPhoneNumber<sup>7+</sup><a name=call.isEmergencyPhoneNumber-callback1></a> ## call.isEmergencyPhoneNumber<sup>7+</sup>
isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback<boolean\>\): void
Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses an asynchronous callback to return the result. Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
...@@ -297,20 +301,20 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => { ...@@ -297,20 +301,20 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => {
``` ```
## call.isEmergencyPhoneNumber<sup>7+</sup><a name=call.isEmergencyPhoneNumber-callback2></a> ## call.isEmergencyPhoneNumber<sup>7+</sup>
isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback<boolean\>\): void isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback<boolean\>\): void
Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses an asynchronous callback to return the result. Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| | options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#emergencynumberoptions7).|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.<br>- **true**: The called number is an emergency number.<br>- **false**: The called number is not an emergency number.|
**Example** **Example**
...@@ -322,20 +326,20 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, value) => { ...@@ -322,20 +326,20 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, value) => {
``` ```
## call.isEmergencyPhoneNumber<sup>7+</sup><a name=call.isEmergencyPhoneNumber-promise></a> ## call.isEmergencyPhoneNumber<sup>7+</sup>
isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise<boolean\> isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise<boolean\>
Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses a promise to return the result. Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------- | ---- | ------------------------------------------------------------ | | ----------- | ---------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| | options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#emergencynumberoptions7).|
**Return Value** **Return Value**
...@@ -354,17 +358,17 @@ promise.then(data => { ...@@ -354,17 +358,17 @@ promise.then(data => {
}); });
``` ```
## call.formatPhoneNumber<sup>7+</sup><a name=call.formatPhoneNumber-callback1></a> ## call.formatPhoneNumber<sup>7+</sup>
formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback<string\>\): void
Formats a phone number based on the specified ISO country code. This function uses an asynchronous callback to return the result. Formats a phone number based on the specified ISO country code. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ------------------------------------ | | ----------- | --------------------------- | ---- | ------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result.|
...@@ -378,20 +382,20 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => { ...@@ -378,20 +382,20 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => {
``` ```
## call.formatPhoneNumber<sup>7+</sup><a name=call.formatPhoneNumber-callback2></a> ## call.formatPhoneNumber<sup>7+</sup>
formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback<string\>\): void formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback<string\>\): void
Formats a phone number based on specified formatting options. This function uses an asynchronous callback to return the result. Formats a phone number based on specified formatting options. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ------------------------------------------------------------ | | ----------- | --------------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| | options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#numberformatoptions7).|
| callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -405,20 +409,20 @@ call.formatPhoneNumber("138xxxxxxxx",{ ...@@ -405,20 +409,20 @@ call.formatPhoneNumber("138xxxxxxxx",{
``` ```
## call.formatPhoneNumber<sup>7+</sup><a name=call.formatPhoneNumber-promise></a> ## call.formatPhoneNumber<sup>7+</sup>
formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise<string\> formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise<string\>
Formats a phone number based on specified formatting options. This function uses a promise to return the result. Formats a phone number based on specified formatting options. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------- | ---- | ------------------------------------------------------------ | | ----------- | ------------------- | ---- | ------------------------------------------------------------ |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| | options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#numberformatoptions7).|
**Return Value** **Return Value**
...@@ -439,11 +443,11 @@ promise.then(data => { ...@@ -439,11 +443,11 @@ promise.then(data => {
}); });
``` ```
## call.formatPhoneNumberToE164<sup>7+</sup><a name=call.formatPhoneNumberToE164-callback></a> ## call.formatPhoneNumberToE164<sup>7+</sup>
formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback<string\>\): void formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback<string\>\): void
Converts a phone number into the E.164 format. This function uses an asynchronous callback to return the result. Converts a phone number into the E.164 format. This API uses an asynchronous callback to return the result.
The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned. The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.
...@@ -453,7 +457,7 @@ All country codes are supported. ...@@ -453,7 +457,7 @@ All country codes are supported.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | --------------------------- | ---- | ----------------------------------------------------- | | ----------- | --------------------------- | ---- | ----------------------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. |
...@@ -470,11 +474,11 @@ call.formatPhoneNumberToE164("138xxxxxxxx",{ ...@@ -470,11 +474,11 @@ call.formatPhoneNumberToE164("138xxxxxxxx",{
``` ```
## call.formatPhoneNumberToE164<sup>7+</sup><a name=call.formatPhoneNumberToE164-promise></a> ## call.formatPhoneNumberToE164<sup>7+</sup>
formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<string\> formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise<string\>
Converts a phone number into the E.164 format. This function uses a promise to return the result. Converts a phone number into the E.164 format. This API uses a promise to return the result.
The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned. The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned.
...@@ -484,7 +488,7 @@ All country codes are supported. ...@@ -484,7 +488,7 @@ All country codes are supported.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------- |
| phoneNumber | string | Yes | Phone number. | | phoneNumber | string | Yes | Phone number. |
| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.| | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.|
...@@ -508,43 +512,45 @@ promise.then(data => { ...@@ -508,43 +512,45 @@ promise.then(data => {
}); });
``` ```
## DialOptions<a name=DialOptions></a> ## DialOptions
Provides an option for determining whether a call is a video call. Provides an option for determining whether a call is a video call.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Parameter | Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ | | ------ | ------- | ---- | ------------------------------------------------------------ |
| extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call| | extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
## CallState<a name=CallState></a> ## CallState
Enumerates call states. Enumerates call states.
| Variable | Value | Description | **System capability**: SystemCapability.Telephony.CallManager
| Name | Value | Description |
| ------------------ | ---- | ------------------------------------------------------------ | | ------------------ | ---- | ------------------------------------------------------------ |
| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown.<br>**System capability**: SystemCapability.Telephony.CallManager| | CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. |
| CALL_STATE_IDLE | 0 | No call is in progress.<br>**System capability**: SystemCapability.Telephony.CallManager| | CALL_STATE_IDLE | 0 | No call is in progress. |
| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state.<br>**System capability**: SystemCapability.Telephony.CallManager| | CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. |
| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.<br>**System capability**: SystemCapability.Telephony.CallManager| | CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.|
## EmergencyNumberOptions<sup>7+</sup><a name=EmergencyNumberOptions></a> ## EmergencyNumberOptions<sup>7+</sup>
Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot. Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Parameter | Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------ | | ------ | ------ | ---- | ------------------------------------------ |
| slotId | number | No | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | No | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
## NumberFormatOptions<sup>7+</sup><a name=NumberFormatOptions></a> ## NumberFormatOptions<sup>7+</sup>
Provides an option for number formatting. Provides an option for number formatting.
**System capability**: SystemCapability.Telephony.CallManager **System capability**: SystemCapability.Telephony.CallManager
| Parameter | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------------------------------------------------------- | | ----------- | ------ | ---- | ---------------------------------------------------------- |
| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| | countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.|
...@@ -9,57 +9,62 @@ ...@@ -9,57 +9,62 @@
import hiTraceChain from '@ohos.hiTraceChain'; import hiTraceChain from '@ohos.hiTraceChain';
``` ```
## System Capabilities
SystemCapability.HiviewDFX.HiTrace
## HiTraceFlag ## HiTraceFlag
Enumerates trace flag types. Enumerates trace flag types.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name| Default Value| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| DEFAULT | 0 | Default flag| | DEFAULT | 0 | Default flag. |
| INCLUDE_ASYNC | 1 | Asynchronous call flag| | INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. |
| DONOT_CREATE_SPAN | 1 << 1 | No span flag| | DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. |
| TP_INFO | 1 << 2 | Trace point flag| | TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. |
| NO_BE_INFO | 1 << 3 | No begin/end flag| | NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed.|
| DISABLE_LOG | 1 << 4 | Log association flag| | DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. |
| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag| | FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. |
| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag| | D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices.|
## HiTraceTracepointType ## HiTraceTracepointType
Enumerates trace point types. Enumerates trace point types.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name| Default Value| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| CS | 0 | Client Send| | CS | 0 | Client Send (CS) trace point. |
| CR | 1 | Client Receive| | CR | 1 | Client Receive (CS) trace point. |
| SS | 2 | Server Send| | SS | 2 | Server Send (SS) trace point. |
| SR | 3 | Server Receive| | SR | 3 | Server Receive (SR) trace point. |
| GENERAL | 4 | General| | GENERAL | 4 | General trace points except CS, CR, SS, and SR.|
## HiTraceCommunicationMode ## HiTraceCommunicationMode
Enumerates communication modes. Enumerates communication modes.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Default Value| Description| | Name| Default Value| Description|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| DEFAULT | 0 | Default mode| | DEFAULT | 0 | Default communication mode. |
| THREAD | 1 | Inter-thread communication| | THREAD | 1 | Inter-thread communication. |
| PROCESS | 2 | Inter-process communication| | PROCESS | 2 | Inter-process communication. |
| DEVICE | 3 | Inter-device communication| | DEVICE | 3 | Inter-device communication. |
## HiTraceId ## HiTraceId
Defines a **HiTraceId** object. Defines a **HiTraceId** object.
**System capability**: SystemCapability.HiviewDFX.HiTrace
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| chainId | bigint | Yes| Call chain ID.| | chainId | bigint | Yes| Call chain ID. |
| spanId | number | No| Span ID.| | spanId | number | No| Span ID. |
| parentSpanId | number | No| Parent span ID.| | parentSpanId | number | No| Parent span ID. |
| flags | number | No| Trace flag combination.| | flags | number | No| Trace flag combination.|
## hiTraceChain.begin ## hiTraceChain.begin
...@@ -68,6 +73,8 @@ begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId ...@@ -68,6 +73,8 @@ begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId
Starts call chain tracing. This API works in synchronous manner. Starts call chain tracing. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -93,6 +100,8 @@ end(id: HiTraceId): void ...@@ -93,6 +100,8 @@ end(id: HiTraceId): void
Stops call chain tracing. This API works in synchronous manner. Stops call chain tracing. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -113,6 +122,8 @@ getId(): HiTraceId ...@@ -113,6 +122,8 @@ getId(): HiTraceId
Obtains the trace ID. This API works in synchronous manner. Obtains the trace ID. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -133,6 +144,8 @@ setId(id: HiTraceId): void ...@@ -133,6 +144,8 @@ setId(id: HiTraceId): void
Sets a trace ID. This API works in synchronous manner. Sets a trace ID. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -153,6 +166,8 @@ clearId(): void ...@@ -153,6 +166,8 @@ clearId(): void
Clears the trace ID. This API works in synchronous manner. Clears the trace ID. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Example** **Example**
``` ```
...@@ -167,6 +182,8 @@ createSpan(): HiTraceId ...@@ -167,6 +182,8 @@ createSpan(): HiTraceId
Creates a trace span. This API works in synchronous manner. Creates a trace span. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Return value** **Return value**
| Type| Description| | Type| Description|
...@@ -187,6 +204,8 @@ tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTr ...@@ -187,6 +204,8 @@ tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTr
Triggers a trace point. This API works in synchronous manner. Triggers a trace point. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -210,6 +229,8 @@ isValid(id: HiTraceId): boolean ...@@ -210,6 +229,8 @@ isValid(id: HiTraceId): boolean
Checks whether a **HiTraceId** instance is valid. This API works in synchronous manner. Checks whether a **HiTraceId** instance is valid. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -235,6 +256,8 @@ isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean ...@@ -235,6 +256,8 @@ isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean
Checks whether the specified trace flag in the **HiTraceId** instance is enabled. This API works in synchronous manner. Checks whether the specified trace flag in the **HiTraceId** instance is enabled. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
...@@ -262,6 +285,8 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void ...@@ -262,6 +285,8 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void
Enables the specified trace flag in the **HiTraceId** instance. This API works in synchronous manner. Enables the specified trace flag in the **HiTraceId** instance. This API works in synchronous manner.
**System capability**: SystemCapability.HiviewDFX.HiTrace
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
......
...@@ -37,8 +37,8 @@ httpRequest.request( ...@@ -37,8 +37,8 @@ httpRequest.request(
extraData: { extraData: {
"data": "data to send", "data": "data to send",
}, },
connectTimeout: 60000, // Optional. The default value is **60000**, in ms. connectTimeout: 60000, // Optional. The default value is 60000, in ms.
readTimeout: 60000, // Optional. The default value is **60000**, in ms. readTimeout: 60000, // Optional. The default value is 60000, in ms.
},(err, data) => { },(err, data) => {
if (!err) { if (!err) {
// data.result contains the HTTP response. It is up to you whether to parse the content. // data.result contains the HTTP response. It is up to you whether to parse the content.
...@@ -60,7 +60,7 @@ httpRequest.request( ...@@ -60,7 +60,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
...@@ -68,7 +68,7 @@ Creates an HTTP request. You can use this API to initiate or destroy an HTTP req ...@@ -68,7 +68,7 @@ Creates an HTTP request. You can use this API to initiate or destroy an HTTP req
| Type | Description | | Type | Description |
| :---------- | :----------------------------------------------------------- | | :---------- | :----------------------------------------------------------- |
| HttpRequest | An **HttpRequest **object, which contains the **request**, **destroy**, **on**, or **off** method.| | HttpRequest | An **HttpRequest** object, which contains the **request**, **destroy**, **on**, or **off** method.|
**Example** **Example**
...@@ -137,25 +137,25 @@ Initiates an HTTP request containing specified options to a given URL. This API ...@@ -137,25 +137,25 @@ Initiates an HTTP request containing specified options to a given URL. This API
``` ```
httpRequest.request("EXAMPLE_URL", httpRequest.request("EXAMPLE_URL",
{ {
method: 'GET', method: 'GET',
header: { header: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
readTimeout: 60000, readTimeout: 60000,
connectTimeout: 60000 connectTimeout: 60000
},(err, data) => { }, (err, data) => {
if (!err) { if (!err) {
console.info('Result:' + data.result); console.info('Result:' + data.result);
console.info('code:' + data.responseCode); console.info('code:' + data.responseCode);
console.info('header:' + data.header); console.info('header:' + data.header);
console.info('cookies:' + data.cookies); // 8+ console.info('cookies:' + data.cookies); // 8+
console.info('header['Content-Type']:' + data.header['Content-Type']); console.info('header.Content-Type:' + data.header['Content-Type']);
console.info('header['Status-Line']:' + data.header['Status-Line']); console.info('header.Status-Line:' + data.header['Status-Line']);
console.info('header.Date:' + data.header.Date); console.info('header.Date:' + data.header.Date);
console.info('header.Server:' + data.header.Server); console.info('header.Server:' + data.header.Server);
} else { } else {
console.info('error:' + err.data); console.info('error:' + err.data);
} }
}); });
``` ```
...@@ -188,24 +188,24 @@ Initiates an HTTP request to a given URL. This API uses a promise to return the ...@@ -188,24 +188,24 @@ Initiates an HTTP request to a given URL. This API uses a promise to return the
``` ```
let promise = httpRequest.request("EXAMPLE_URL", { let promise = httpRequest.request("EXAMPLE_URL", {
method: "GET", method: "GET",
connectTimeout: 60000, connectTimeout: 60000,
readTimeout: 60000, readTimeout: 60000,
header: { header: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
}); });
promise.then((value) => { promise.then((value) => {
console.info('Result:' + value.result); console.info('Result:' + value.result);
console.info('code:' + value.responseCode); console.info('code:' + value.responseCode);
console.info('header:' + value.header); console.info('header:' + value.header);
console.info('cookies:' + value.cookies); // 8+ console.info('cookies:' + value.cookies); // 8+
console.info('header['Content-Type']:' + value.header['Content-Type']); console.info('header.Content-Type:' + value.header['Content-Type']);
console.info('header['Status-Line']:' + value.header['Status-Line']); console.info('header.Status-Line:' + value.header['Status-Line']);
console.info('header.Date:' + value.header.Date); console.info('header.Date:' + value.header.Date);
console.info('header.Server:' + value.header.Server); console.info('header.Server:' + value.header.Server);
}).catch((err) => { }).catch((err) => {
console.error(`errCode:${err.code}, errMessage:${err.data}`); console.error(`errCode:${err.code}, errMessage:${err.data}`);
}); });
``` ```
...@@ -246,9 +246,9 @@ Registers an observer for HTTP Response Header events. ...@@ -246,9 +246,9 @@ Registers an observer for HTTP Response Header events.
``` ```
httpRequest.on('headerReceive', (err, data) => { httpRequest.on('headerReceive', (err, data) => {
if (!err) { if (!err) {
console.info('header: ' + data.header); console.info('header: ' + data.header);
} else { } else {
console.info('error:' + err.data); console.info('error:' + err.data);
} }
}); });
``` ```
...@@ -280,9 +280,9 @@ Unregisters the observer for HTTP Response Header events. ...@@ -280,9 +280,9 @@ Unregisters the observer for HTTP Response Header events.
``` ```
httpRequest.on('headerReceive', (err, data) => { httpRequest.on('headerReceive', (err, data) => {
if (!err) { if (!err) {
console.info('header: ' + data.header); console.info('header: ' + data.header);
} else { } else {
console.info('error:' + err.data); console.info('error:' + err.data);
} }
}); });
httpRequest.off('headerReceive'); httpRequest.off('headerReceive');
......
# Network Connection Management # Network Connection Management
> **NOTE**<br/> > **NOTE**
> >
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -17,7 +17,7 @@ getDefaultNet(callback: AsyncCallback\<NetHandle>): void ...@@ -17,7 +17,7 @@ getDefaultNet(callback: AsyncCallback\<NetHandle>): void
Obtains the default active data network. This API uses an asynchronous callback to return the result. Obtains the default active data network. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -42,11 +42,11 @@ getDefaultNet(): Promise\<NetHandle> ...@@ -42,11 +42,11 @@ getDefaultNet(): Promise\<NetHandle>
Obtains the default active data network. This API uses a promise to return the result. Obtains the default active data network. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
**Return value** **Return Value**
| Type | Description | | Type | Description |
| --------------------------------- | ------------------------------------- | | --------------------------------- | ------------------------------------- |
...@@ -91,7 +91,7 @@ Checks whether the default data network is activated. This API uses a promise to ...@@ -91,7 +91,7 @@ Checks whether the default data network is activated. This API uses a promise to
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ----------------- | ----------------------------------------------- | | ----------------- | ----------------------------------------------- |
...@@ -111,7 +111,7 @@ getAllNets(callback: AsyncCallback&lt;Array&lt;NetHandle&gt;&gt;): void ...@@ -111,7 +111,7 @@ getAllNets(callback: AsyncCallback&lt;Array&lt;NetHandle&gt;&gt;): void
Obtains the list of all active data networks. This API uses an asynchronous callback to return the result. Obtains the list of all active data networks. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -136,11 +136,11 @@ getAllNets(): Promise&lt;Array&lt;NetHandle&gt;&gt; ...@@ -136,11 +136,11 @@ getAllNets(): Promise&lt;Array&lt;NetHandle&gt;&gt;
Obtains the list of all active data networks. This API uses a promise to return the result. Obtains the list of all active data networks. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
**Return value** **Return Value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[NetHandle](#nethandle)&gt;&gt; | Promise used to return the result.| | Promise&lt;Array&lt;[NetHandle](#nethandle)&gt;&gt; | Promise used to return the result.|
...@@ -157,9 +157,9 @@ connection.getAllNets().then(function (nets) { ...@@ -157,9 +157,9 @@ connection.getAllNets().then(function (nets) {
getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\<ConnectionProperties>): void getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\<ConnectionProperties>): void
Obtains connection properties of the network corresponding to the **netHandle**. This API uses an asynchronous callback to return the result. Obtains connection properties of the network corresponding to given network handle. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -185,9 +185,9 @@ connection.getDefaultNet().then(function (netHandle) { ...@@ -185,9 +185,9 @@ connection.getDefaultNet().then(function (netHandle) {
getConnectionProperties(netHandle: NetHandle): Promise\<ConnectionProperties> getConnectionProperties(netHandle: NetHandle): Promise\<ConnectionProperties>
Obtains connection properties of the network corresponding to the **netHandle**. This API uses a promise to return the result. Obtains connection properties of the network corresponding to **netHandle**. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -197,7 +197,7 @@ Obtains connection properties of the network corresponding to the **netHandle**. ...@@ -197,7 +197,7 @@ Obtains connection properties of the network corresponding to the **netHandle**.
| --------- | ----------------------- | ---- | ---------------- | | --------- | ----------------------- | ---- | ---------------- |
| netHandle | [NetHandle](#nethandle) | Yes | Network handle.| | netHandle | [NetHandle](#nethandle) | Yes | Network handle.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ------------------------------------------------------- | --------------------------------- | | ------------------------------------------------------- | --------------------------------- |
...@@ -217,9 +217,9 @@ connection.getDefaultNet().then(function (netHandle) { ...@@ -217,9 +217,9 @@ connection.getDefaultNet().then(function (netHandle) {
getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\<NetCapabilities>): void getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\<NetCapabilities>): void
Obtains capability information of the network corresponding to the **netHandle**. This API uses an asynchronous callback to return the result. Obtains capability information of the network corresponding to **netHandle**. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -245,9 +245,9 @@ connection.getDefaultNet().then(function (netHandle) { ...@@ -245,9 +245,9 @@ connection.getDefaultNet().then(function (netHandle) {
getNetCapabilities(netHandle: NetHandle): Promise\<NetCapabilities> getNetCapabilities(netHandle: NetHandle): Promise\<NetCapabilities>
Obtains capability information of the network corresponding to the **netHandle**. This API uses a promise to return the result. Obtains capability information of the network corresponding to **netHandle**. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -257,7 +257,7 @@ Obtains capability information of the network corresponding to the **netHandle** ...@@ -257,7 +257,7 @@ Obtains capability information of the network corresponding to the **netHandle**
| --------- | ----------------------- | ---- | ---------------- | | --------- | ----------------------- | ---- | ---------------- |
| netHandle | [NetHandle](#nethandle) | Yes | Network handle.| | netHandle | [NetHandle](#nethandle) | Yes | Network handle.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| --------------------------------------------- | --------------------------------- | | --------------------------------------------- | --------------------------------- |
...@@ -279,7 +279,7 @@ reportNetConnected(netHandle: NetHandle, callback: AsyncCallback&lt;void&gt;): v ...@@ -279,7 +279,7 @@ reportNetConnected(netHandle: NetHandle, callback: AsyncCallback&lt;void&gt;): v
Reports connection of the data network. This API uses an asynchronous callback to return the result. Reports connection of the data network. This API uses an asynchronous callback to return the result.
**Required permissions** : ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -306,7 +306,7 @@ reportNetConnected(netHandle: NetHandle): Promise&lt;void&gt; ...@@ -306,7 +306,7 @@ reportNetConnected(netHandle: NetHandle): Promise&lt;void&gt;
Reports connection of the data network. This API uses a promise to return the result. Reports connection of the data network. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -315,7 +315,7 @@ Reports connection of the data network. This API uses a promise to return the re ...@@ -315,7 +315,7 @@ Reports connection of the data network. This API uses a promise to return the re
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).| | netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).|
**Return value** **Return Value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
...@@ -337,7 +337,7 @@ reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback&lt;void&gt;) ...@@ -337,7 +337,7 @@ reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback&lt;void&gt;)
Reports disconnection of the data network. This API uses an asynchronous callback to return the result. Reports disconnection of the data network. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -364,7 +364,7 @@ reportNetDisconnected(netHandle: NetHandle): Promise&lt;void&gt; ...@@ -364,7 +364,7 @@ reportNetDisconnected(netHandle: NetHandle): Promise&lt;void&gt;
Reports disconnection of the data network. This API uses a promise to return the result. Reports disconnection of the data network. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -373,7 +373,7 @@ Reports disconnection of the data network. This API uses a promise to return the ...@@ -373,7 +373,7 @@ Reports disconnection of the data network. This API uses a promise to return the
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).| | netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).|
**Return value** **Return Value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
...@@ -394,7 +394,7 @@ getAddressesByName(host: string, callback: AsyncCallback\<Array\<NetAddress>>): ...@@ -394,7 +394,7 @@ getAddressesByName(host: string, callback: AsyncCallback\<Array\<NetAddress>>):
Resolves the host name by using the default network to obtain all IP addresses. This API uses an asynchronous callback to return the result. Resolves the host name by using the default network to obtain all IP addresses. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -402,7 +402,7 @@ Resolves the host name by using the default network to obtain all IP addresses. ...@@ -402,7 +402,7 @@ Resolves the host name by using the default network to obtain all IP addresses.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------- | ---- | ------------------ | | -------- | ------------------------------------------------- | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
| callback | AsyncCallback\<Array\<[NetAddress](#netaddress)>> | Yes | Callback used to return the result. | | callback | AsyncCallback\<Array\<[NetAddress](#netaddress)>> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -421,7 +421,7 @@ getAddressesByName(host: string): Promise\<Array\<NetAddress>> ...@@ -421,7 +421,7 @@ getAddressesByName(host: string): Promise\<Array\<NetAddress>>
Resolves the host name by using the default network to obtain all IP addresses. This API uses a promise to return the result. Resolves the host name by using the default network to obtain all IP addresses. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -429,13 +429,13 @@ Resolves the host name by using the default network to obtain all IP addresses. ...@@ -429,13 +429,13 @@ Resolves the host name by using the default network to obtain all IP addresses.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------ | | ------ | ------ | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ------------------------------------------- | ----------------------------- | | ------------------------------------------- | ----------------------------- |
| Promise\<Array\<[NetAddress](#netaddress)>> | Promise used to return the IP addresses obtained.| | Promise\<Array\<[NetAddress](#netaddress)>> | Promise used to return the result.|
**Example** **Example**
...@@ -461,7 +461,7 @@ Obtains the handle of the network specified by **netSpecifier**. ...@@ -461,7 +461,7 @@ Obtains the handle of the network specified by **netSpecifier**.
| netSpecifier | [NetSpecifier](#netspecifier) | No | Network specifier. If this parameter is not set, the default network is used. | | netSpecifier | [NetSpecifier](#netspecifier) | No | Network specifier. If this parameter is not set, the default network is used. |
| timeout | number | No | Timeout interval for obtaining the network specified by **netSpecifier**. This parameter is valid only when **netSpecifier** is set.| | timeout | number | No | Timeout interval for obtaining the network specified by **netSpecifier**. This parameter is valid only when **netSpecifier** is set.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ------------------------------- | -------------------- | | ------------------------------- | -------------------- |
...@@ -520,7 +520,7 @@ Registers a listener for **netCapabilitiesChange** events. ...@@ -520,7 +520,7 @@ Registers a listener for **netCapabilitiesChange** events.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed to **netCapabilitiesChange**.<br>**netCapabilitiesChange**: event indicating that the network capabilities have changed.| | type | string | Yes | Event type. The value is fixed to **netCapabilitiesChange**.<br>**netCapabilitiesChange**: event indicating that he network capabilities have changed.|
| callback | Callback<{ netHandle: [NetHandle](#nethandle), netCap: [NetCapabilities](#netcapabilities) }> | Yes | Callback used to return the result. | | callback | Callback<{ netHandle: [NetHandle](#nethandle), netCap: [NetCapabilities](#netcapabilities) }> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -630,7 +630,7 @@ register(callback: AsyncCallback\<void>): void ...@@ -630,7 +630,7 @@ register(callback: AsyncCallback\<void>): void
Registers a listener for network status changes. Registers a listener for network status changes.
**Required permissions**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -674,15 +674,15 @@ netConnection.unregister(function (error) { ...@@ -674,15 +674,15 @@ netConnection.unregister(function (error) {
Defines the handle of the data network. Defines the handle of the data network.
Before invoking **NetHandle** APIs, call **getNetHandle** to obtain a **NetHandle** object. Before invoking NetHandle APIs, call **getNetHandle** to obtain a **NetHandle** object.
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
### Attributes ### Parameters
| Name| Type | Description | | Name| Type | Description |
| ------ | ------ | ------------------------- | | ------ | ------ | ------------------------- |
| netId | number | Network ID. The value must be greater than or equal to **100**.| | netId | number | Network ID. The value must be greater than or equal to 100.|
### bindSocket ### bindSocket
...@@ -731,7 +731,7 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses ...@@ -731,7 +731,7 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| socketParam | TCPSocket \| UDPSocket | Yes | **TCPSocket** or **UDPSocket** object.| | socketParam | TCPSocket \| UDPSocket | Yes | **TCPSocket** or **UDPSocket** object.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
...@@ -767,7 +767,7 @@ Resolves the host name by using the corresponding network to obtain all IP addre ...@@ -767,7 +767,7 @@ Resolves the host name by using the corresponding network to obtain all IP addre
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------- | ---- | ------------------ | | -------- | ------------------------------------------------- | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
| callback | AsyncCallback\<Array\<[NetAddress](#netaddress)>> | Yes | Callback used to return the result. | | callback | AsyncCallback\<Array\<[NetAddress](#netaddress)>> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -794,9 +794,9 @@ Resolves the host name by using the corresponding network to obtain all IP addre ...@@ -794,9 +794,9 @@ Resolves the host name by using the corresponding network to obtain all IP addre
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------ | | ------ | ------ | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ------------------------------------------- | ----------------------------- | | ------------------------------------------- | ----------------------------- |
...@@ -825,7 +825,7 @@ Resolves the host name by using the corresponding network to obtain the first IP ...@@ -825,7 +825,7 @@ Resolves the host name by using the corresponding network to obtain the first IP
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------- | ---- | ------------------ | | -------- | ----------------------------------------- | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
| callback | AsyncCallback\<[NetAddress](#netaddress)> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NetAddress](#netaddress)> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -852,9 +852,9 @@ Resolves the host name by using the corresponding network to obtain the first IP ...@@ -852,9 +852,9 @@ Resolves the host name by using the corresponding network to obtain the first IP
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------ | | ------ | ------ | ---- | ------------------ |
| host | string | Yes | Host name to resolve.| | host | string | Yes | Host name to be resolved.|
**Return value** **Return Value**
| Type | Description | | Type | Description |
| ----------------------------------- | ------------------------------- | | ----------------------------------- | ------------------------------- |
...@@ -901,7 +901,7 @@ Defines the network capability. ...@@ -901,7 +901,7 @@ Defines the network capability.
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
| Name | Value α | Description | | Name | Value | Description |
| ------------------------ | ---- | ---------------------- | | ------------------------ | ---- | ---------------------- |
| NET_CAPABILITY_MMS | 0 | The network can connect to the carrier's Multimedia Messaging Service Center (MMSC) to send and receive multimedia messages.| | NET_CAPABILITY_MMS | 0 | The network can connect to the carrier's Multimedia Messaging Service Center (MMSC) to send and receive multimedia messages.|
| NET_CAPABILITY_NOT_METERED | 11 | The network traffic is not metered.| | NET_CAPABILITY_NOT_METERED | 11 | The network traffic is not metered.|
...@@ -915,7 +915,7 @@ Defines the network type. ...@@ -915,7 +915,7 @@ Defines the network type.
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
| Name | Value α | Description | | Name | Value | Description |
| --------------- | ---- | ----------- | | --------------- | ---- | ----------- |
| BEARER_CELLULAR | 0 | Cellular network | | BEARER_CELLULAR | 0 | Cellular network |
| BEARER_WIFI | 1 | Wi-Fi network| | BEARER_WIFI | 1 | Wi-Fi network|
...@@ -938,7 +938,7 @@ Defines the network connection properties. ...@@ -938,7 +938,7 @@ Defines the network connection properties.
## LinkAddress ## LinkAddress
Defines network link information. Network link information.
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -949,7 +949,7 @@ Defines network link information. ...@@ -949,7 +949,7 @@ Defines network link information.
## RouteInfo ## RouteInfo
Defines network route information. Network route information.
**System capability**: SystemCapability.Communication.NetManager.Core **System capability**: SystemCapability.Communication.NetManager.Core
...@@ -971,4 +971,4 @@ Defines the network address. ...@@ -971,4 +971,4 @@ Defines the network address.
| ------- | ------ | ------------------------------ | | ------- | ------ | ------------------------------ |
| address | string | Network address. | | address | string | Network address. |
| family | number | Address family identifier. The value is **1** for IPv4 and **2** for IPv6. The default value is **1**.| | family | number | Address family identifier. The value is **1** for IPv4 and **2** for IPv6. The default value is **1**.|
| port | number | Port number. The value range is 0 to 65535. | | port | number | Port number. The value ranges from **0** to **65535**. |
...@@ -600,13 +600,13 @@ Defines the network type. ...@@ -600,13 +600,13 @@ Defines the network type.
| Name | Value | Description | | Name | Value | Description |
| -------------------- | ---- | ------------------------------------------------------------ | | -------------------- | ---- | ------------------------------------------------------------ |
| NETWORK_TYPE_UNKNOWN | 0 | Unknown network | | NETWORK_TYPE_UNKNOWN | 0 | Unknown network. |
| NETWORK_TYPE_GSM | 1 | GSM network | | NETWORK_TYPE_GSM | 1 | GSM network. |
| NETWORK_TYPE_CDMA | 2 | CDMA network | | NETWORK_TYPE_CDMA | 2 | CDMA network. |
| NETWORK_TYPE_WCDMA | 3 | WCDMA network | | NETWORK_TYPE_WCDMA | 3 | WCDMA network. |
| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network| | NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network.|
| NETWORK_TYPE_LTE | 5 | LTE network | | NETWORK_TYPE_LTE | 5 | LTE network. |
| NETWORK_TYPE_NR | 6 | 5G NR network | | NETWORK_TYPE_NR | 6 | 5G NR network. |
## NetworkState ## NetworkState
......
...@@ -15,7 +15,7 @@ import sim from '@ohos.telephony.sim'; ...@@ -15,7 +15,7 @@ import sim from '@ohos.telephony.sim';
isSimActive\(slotId: number, callback: AsyncCallback<boolean\>\): void isSimActive\(slotId: number, callback: AsyncCallback<boolean\>\): void
Checks whether the SIM card in the specified slot is activated. This function uses an asynchronous callback to return the result. Checks whether the SIM card in the specified slot is activated. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -23,7 +23,7 @@ Checks whether the SIM card in the specified slot is activated. This function us ...@@ -23,7 +23,7 @@ Checks whether the SIM card in the specified slot is activated. This function us
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------------- | | -------- | --------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -39,7 +39,7 @@ sim.isSimActive(0, (err, data) => { ...@@ -39,7 +39,7 @@ sim.isSimActive(0, (err, data) => {
isSimActive\(slotId: number\): Promise<boolean\> isSimActive\(slotId: number\): Promise<boolean\>
Checks whether the SIM card in the specified slot is activated. This function uses a promise to return the result. Checks whether the SIM card in the specified slot is activated. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -47,9 +47,9 @@ Checks whether the SIM card in the specified slot is activated. This function us ...@@ -47,9 +47,9 @@ Checks whether the SIM card in the specified slot is activated. This function us
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ---------------------------------- | | --------------------- | ---------------------------------- |
...@@ -71,7 +71,7 @@ promise.then(data => { ...@@ -71,7 +71,7 @@ promise.then(data => {
getDefaultVoiceSlotId\(callback: AsyncCallback<number\>\): void getDefaultVoiceSlotId\(callback: AsyncCallback<number\>\): void
Obtains the default slot ID of the SIM card that provides voice services. This function uses an asynchronous callback to return the result. Obtains the default slot ID of the SIM card that provides voice services. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -94,11 +94,11 @@ sim.getDefaultVoiceSlotId((err, data) => { ...@@ -94,11 +94,11 @@ sim.getDefaultVoiceSlotId((err, data) => {
getDefaultVoiceSlotId\(\): Promise<number\> getDefaultVoiceSlotId\(\): Promise<number\>
Obtains the default slot ID of the SIM card that provides voice services. This function uses a promise to return the result. Obtains the default slot ID of the SIM card that provides voice services. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | --------------------------------------- | | ----------------- | --------------------------------------- |
...@@ -119,7 +119,7 @@ promise.then(data => { ...@@ -119,7 +119,7 @@ promise.then(data => {
hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void hasOperatorPrivileges(slotId: number, callback: AsyncCallback\<boolean\>): void
Checks whether the application (caller) has been granted the operator permission. This function uses an asynchronous callback to return the result. Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -127,7 +127,7 @@ Checks whether the application (caller) has been granted the operator permission ...@@ -127,7 +127,7 @@ Checks whether the application (caller) has been granted the operator permission
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | ---------------------------------------- | | -------- | ------------------------ | ---- | ---------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -140,9 +140,9 @@ sim.hasOperatorPrivileges(0, (err, data) => { ...@@ -140,9 +140,9 @@ sim.hasOperatorPrivileges(0, (err, data) => {
## sim.hasOperatorPrivileges<sup>7+</sup> ## sim.hasOperatorPrivileges<sup>7+</sup>
hasOperatorPrivileges(slotId: number): Promise<boolean> hasOperatorPrivileges(slotId: number): Promise<boolean\>
Checks whether the application (caller) has been granted the operator permission. This function uses a promise to return the result. Checks whether the application (caller) has been granted the operator permission. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -150,9 +150,9 @@ Checks whether the application (caller) has been granted the operator permission ...@@ -150,9 +150,9 @@ Checks whether the application (caller) has been granted the operator permission
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------------------- | | ------ | ------ | ---- | ---------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| :----------------- | :---------------------------------------------------------- | | :----------------- | :---------------------------------------------------------- |
...@@ -173,7 +173,7 @@ promise.then(data => { ...@@ -173,7 +173,7 @@ promise.then(data => {
getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): void getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the ISO country code of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. Obtains the ISO country code of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -181,7 +181,7 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio ...@@ -181,7 +181,7 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ---------------------------------------- | | -------- | ----------------------- | ---- | ---------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is a country code, for example, **CN** (China).| | callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is a country code, for example, **CN** (China).|
**Example** **Example**
...@@ -197,7 +197,7 @@ sim.getISOCountryCodeForSim(0, (err, data) => { ...@@ -197,7 +197,7 @@ sim.getISOCountryCodeForSim(0, (err, data) => {
getISOCountryCodeForSim\(slotId: number\): Promise<string\> getISOCountryCodeForSim\(slotId: number\): Promise<string\>
Obtains the ISO country code of the SIM card in the specified slot. This function uses a promise to return the result. Obtains the ISO country code of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -205,9 +205,9 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio ...@@ -205,9 +205,9 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
...@@ -229,7 +229,7 @@ promise.then(data => { ...@@ -229,7 +229,7 @@ promise.then(data => {
getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void getSimOperatorNumeric\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the public land mobile network (PLMN) ID of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. Obtains the public land mobile network (PLMN) ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -237,7 +237,7 @@ Obtains the public land mobile network (PLMN) ID of the SIM card in the specifie ...@@ -237,7 +237,7 @@ Obtains the public land mobile network (PLMN) ID of the SIM card in the specifie
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | -------------------------------------- | | -------- | ----------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -253,7 +253,7 @@ sim.getSimOperatorNumeric(0, (err, data) => { ...@@ -253,7 +253,7 @@ sim.getSimOperatorNumeric(0, (err, data) => {
getSimOperatorNumeric\(slotId: number\): Promise<string\> getSimOperatorNumeric\(slotId: number\): Promise<string\>
Obtains the PLMN ID of the SIM card in the specified slot. This function uses a promise to return the result. Obtains the PLMN ID of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -261,9 +261,9 @@ Obtains the PLMN ID of the SIM card in the specified slot. This function uses a ...@@ -261,9 +261,9 @@ Obtains the PLMN ID of the SIM card in the specified slot. This function uses a
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------------------ | | ----------------- | ------------------------------------------------ |
...@@ -285,7 +285,7 @@ promise.then(data => { ...@@ -285,7 +285,7 @@ promise.then(data => {
getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void getSimSpn\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the service provider name (SPN) of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -293,7 +293,7 @@ Obtains the service provider name (SPN) of the SIM card in the specified slot. T ...@@ -293,7 +293,7 @@ Obtains the service provider name (SPN) of the SIM card in the specified slot. T
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | -------------------------------------- | | -------- | ----------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<string\> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -309,7 +309,7 @@ sim.getSimSpn(0, (err, data) => { ...@@ -309,7 +309,7 @@ sim.getSimSpn(0, (err, data) => {
getSimSpn\(slotId: number\): Promise<string\> getSimSpn\(slotId: number\): Promise<string\>
Obtains the SPN of the SIM card in the specified slot. This function uses a promise to return the result. Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -317,9 +317,9 @@ Obtains the SPN of the SIM card in the specified slot. This function uses a prom ...@@ -317,9 +317,9 @@ Obtains the SPN of the SIM card in the specified slot. This function uses a prom
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ----------------------------------------- | | ----------------- | ----------------------------------------- |
...@@ -341,7 +341,7 @@ promise.then(data => { ...@@ -341,7 +341,7 @@ promise.then(data => {
getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void getSimState\(slotId: number, callback: AsyncCallback<SimState\>\): void
Obtains the status of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. Obtains the status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -349,7 +349,7 @@ Obtains the status of the SIM card in the specified slot. This function uses an ...@@ -349,7 +349,7 @@ Obtains the status of the SIM card in the specified slot. This function uses an
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | -------------------------------------- | | -------- | -------------------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[SimState](#simState)\> | Yes | Callback used to return the result. For details, see [SimState](#simState). | | callback | AsyncCallback\<[SimState](#simState)\> | Yes | Callback used to return the result. For details, see [SimState](#simState). |
**Example** **Example**
...@@ -365,7 +365,7 @@ sim.getSimState(0, (err, data) => { ...@@ -365,7 +365,7 @@ sim.getSimState(0, (err, data) => {
getSimState\(slotId: number\): Promise<SimState\> getSimState\(slotId: number\): Promise<SimState\>
Obtains the status of the SIM card in the specified slot. This function uses a promise to return the result. Obtains the status of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -373,9 +373,9 @@ Obtains the status of the SIM card in the specified slot. This function uses a p ...@@ -373,9 +373,9 @@ Obtains the status of the SIM card in the specified slot. This function uses a p
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| -------------------------------- | ------------------------------------------ | | -------------------------------- | ------------------------------------------ |
...@@ -396,7 +396,7 @@ promise.then(data => { ...@@ -396,7 +396,7 @@ promise.then(data => {
getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void getCardType\(slotId: number, callback: AsyncCallback<CardType\>\): void
Obtains the type of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. Obtains the type of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -404,7 +404,7 @@ Obtains the type of the SIM card in the specified slot. This function uses an as ...@@ -404,7 +404,7 @@ Obtains the type of the SIM card in the specified slot. This function uses an as
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | -------------------------------------- | | -------- | ----------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[CardType](#cardtype7)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[CardType](#cardtype7)\> | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -420,7 +420,7 @@ sim.getCardType(0, (err, data) => { ...@@ -420,7 +420,7 @@ sim.getCardType(0, (err, data) => {
getCardType\(slotId: number\): Promise<CardType\> getCardType\(slotId: number\): Promise<CardType\>
Obtains the type of the SIM card in the specified slot. This function uses a promise to return the result. Obtains the type of the SIM card in the specified slot. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -428,9 +428,9 @@ Obtains the type of the SIM card in the specified slot. This function uses a pro ...@@ -428,9 +428,9 @@ Obtains the type of the SIM card in the specified slot. This function uses a pro
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
...@@ -452,7 +452,7 @@ promise.then(data => { ...@@ -452,7 +452,7 @@ promise.then(data => {
hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void hasSimCard\(slotId: number, callback: AsyncCallback<boolean\>\): void
Checks whether the SIM card in the specified slot is installed. This function uses an asynchronous callback to return the result. Checks whether the SIM card in the specified slot is installed. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -460,7 +460,7 @@ Checks whether the SIM card in the specified slot is installed. This function us ...@@ -460,7 +460,7 @@ Checks whether the SIM card in the specified slot is installed. This function us
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------------- | | -------- | --------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -476,7 +476,7 @@ sim.hasSimCard(0, (err, data) => { ...@@ -476,7 +476,7 @@ sim.hasSimCard(0, (err, data) => {
hasSimCard\(slotId: number\): Promise<boolean\> hasSimCard\(slotId: number\): Promise<boolean\>
Checks whether the SIM card in the specified slot is installed. This function uses a promise to return the result. Checks whether the SIM card in the specified slot is installed. This API uses a promise to return the result.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
...@@ -484,9 +484,9 @@ Checks whether the SIM card in the specified slot is installed. This function us ...@@ -484,9 +484,9 @@ Checks whether the SIM card in the specified slot is installed. This function us
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------------------------- | | ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2| | slotId | number | Yes | Card slot ID. The options are as follows:<br>- **0**: card slot 1<br>- **1**: card slot 2|
**Return Value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ---------------------------------- | | --------------------- | ---------------------------------- |
...@@ -512,7 +512,7 @@ Obtains the number of card slots. ...@@ -512,7 +512,7 @@ Obtains the number of card slots.
**System capability**: SystemCapability.Communication.CoreService **System capability**: SystemCapability.Communication.CoreService
**Return Value** **Return value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
...@@ -557,4 +557,4 @@ Enumerates card types. ...@@ -557,4 +557,4 @@ Enumerates card types.
|CU_DUAL_MODE_CARD | 42 | China Unicom dual-mode card| |CU_DUAL_MODE_CARD | 42 | China Unicom dual-mode card|
|DUAL_MODE_TELECOM_LTE_CARD | 43 | China Telecom dual-mode LTE card| |DUAL_MODE_TELECOM_LTE_CARD | 43 | China Telecom dual-mode LTE card|
|DUAL_MODE_UG_CARD | 50 | Dual-mode card (UMTS+GSM)| |DUAL_MODE_UG_CARD | 50 | Dual-mode card (UMTS+GSM)|
|SINGLE_MODE_ISIM_CARD | 60 | Single-card (ISIM)| |SINGLE_MODE_ISIM_CARD<sup>8+</sup> | 60 | Single-card (ISIM)|
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
import sms from '@ohos.telephony.sms'; import sms from '@ohos.telephony.sms';
``` ```
## sms.createMessage<a name=sms.createMessage-callback></a> ## sms.createMessage
createMessage\(pdu: Array<number\>, specification: string, callback: AsyncCallback<ShortMessage\>\): void createMessage\(pdu: Array<number\>, specification: string, callback: AsyncCallback<ShortMessage\>\): void
Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This function uses an asynchronous callback to return the result. Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -24,7 +24,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp ...@@ -24,7 +24,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp
| ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | | ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ |
| pdu | Array&lt;number&gt; | Yes | PDU, which is obtained from the received SMS message. | | pdu | Array&lt;number&gt; | Yes | PDU, which is obtained from the received SMS message. |
| specification | string | Yes | SMS protocol type. <br>- **3gpp**: GSM/UMTS/LTE SMS<br>- **3gpp2**: CDMA SMS| | specification | string | Yes | SMS protocol type. <br>- **3gpp**: GSM/UMTS/LTE SMS<br>- **3gpp2**: CDMA SMS|
| callback | AsyncCallback&lt;[ShortMessage](#ShortMessage)&gt; | Yes | Callback used to return the result. | | callback | AsyncCallback&lt;[ShortMessage](#shortmessage)&gt; | Yes | Callback used to return the result. |
**Example** **Example**
...@@ -38,11 +38,11 @@ sms.createMessage(pdu, specification, (err, data) => { ...@@ -38,11 +38,11 @@ sms.createMessage(pdu, specification, (err, data) => {
``` ```
## sms.createMessage<a name=sms.createMessage-promise></a> ## sms.createMessage
createMessage\(pdu: Array<number\>, specification: string\): Promise<ShortMessage\> createMessage\(pdu: Array<number\>, specification: string\): Promise<ShortMessage\>
Creates an SMS message instance based on the PDU and the specified SMS protocol. This function uses a promise to return the result. Creates an SMS message instance based on the PDU and the specified SMS protocol. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -57,7 +57,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol. ...@@ -57,7 +57,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol.
| Type | Description | | Type | Description |
| -------------------------------------------- | --------------------------------- | | -------------------------------------------- | --------------------------------- |
| Promise&lt;[ShortMessage](#ShortMessage)&gt; | Promise used to return the result.| | Promise&lt;[ShortMessage](#shortmessage)&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -87,7 +87,7 @@ Sends an SMS message. ...@@ -87,7 +87,7 @@ Sends an SMS message.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | | ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| options | [SendMessageOptions](#SendMessageOptions) | Yes | Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#SendMessageOptions).| | options | [SendMessageOptions](#sendmessageoptions) | Yes | Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#sendmessageoptions).|
**Example** **Example**
...@@ -108,11 +108,11 @@ sms.sendMessage(options); ...@@ -108,11 +108,11 @@ sms.sendMessage(options);
``` ```
## sms.getDefaultSmsSlotId<sup>7+</sup><a name=sms.getDefaultSmsSlotId-callback></a> ## sms.getDefaultSmsSlotId<sup>7+</sup>
getDefaultSmsSlotId\(callback: AsyncCallback<number\>\): void getDefaultSmsSlotId\(callback: AsyncCallback<number\>\): void
Obtains the default slot of the SIM card used to send SMS messages. This function uses an asynchronous callback to return the result. Obtains the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -131,11 +131,11 @@ sms.getDefaultSmsSlotId((err, data) => { ...@@ -131,11 +131,11 @@ sms.getDefaultSmsSlotId((err, data) => {
``` ```
## sms.getDefaultSmsSlotId<sup>7+</sup><a name=sms.getDefaultSmsSlotId-promise></a> ## sms.getDefaultSmsSlotId<sup>7+</sup>
getDefaultSmsSlotId\(\): Promise<number\> getDefaultSmsSlotId\(\): Promise<number\>
Obtains the default slot of the SIM card used to send SMS messages. This function uses a promise to return the result. Obtains the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -157,16 +157,18 @@ promise.then(data => { ...@@ -157,16 +157,18 @@ promise.then(data => {
``` ```
## sms.setSmscAddr<sup>7+</sup><a name=sms.setSmscAddr-callback></a> ## sms.setSmscAddr<sup>7+</sup>
setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): void setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback<void\>\): void
Sets the short message service center (SMSC) address. This function uses an asynchronous callback to return the result. Sets the short message service center (SMSC) address. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -186,16 +188,18 @@ sms.setSmscAddr(slotId, smscAddr, (err,data) => { ...@@ -186,16 +188,18 @@ sms.setSmscAddr(slotId, smscAddr, (err,data) => {
``` ```
## sms.setSmscAddr<sup>7+</sup><a name=sms.setSmscAddr-promise></a> ## sms.setSmscAddr<sup>7+</sup>
setSmscAddr\(slotId: number, smscAddr: string\): Promise<void\> setSmscAddr\(slotId: number, smscAddr: string\): Promise<void\>
Sets the SMSC address. This function uses a promise to return the result. Sets the SMSC address. This API uses a promise to return the result.
**Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -223,17 +227,17 @@ promise.then(data => { ...@@ -223,17 +227,17 @@ promise.then(data => {
``` ```
## sms.getSmscAddr<sup>7+</sup><a name=sms.getSmscAddr-callback></a> ## sms.getSmscAddr<sup>7+</sup>
getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void getSmscAddr\(slotId: number, callback: AsyncCallback<string\>\): void
Obtains the SMSC address. This function uses an asynchronous callback to return the result. Obtains the SMSC address. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
**Note:** This is a system API and it is used only for system applications. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -252,17 +256,17 @@ sms.getSmscAddr(slotId, (err, data) => { ...@@ -252,17 +256,17 @@ sms.getSmscAddr(slotId, (err, data) => {
``` ```
## sms.getSmscAddr<sup>7+</sup><a name=sms.getSmscAddr-promise></a> ## sms.getSmscAddr<sup>7+</sup>
getSmscAddr\(slotId: number\): Promise<string\> getSmscAddr\(slotId: number\): Promise<string\>
Obtains the SMSC address. This function uses a promise to return the result. Obtains the SMSC address. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission)
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
**Note:** This is a system API and it is used only for system applications. This is a system API and cannot be called by third-party applications.
**Parameters** **Parameters**
...@@ -288,11 +292,11 @@ promise.then(data => { ...@@ -288,11 +292,11 @@ promise.then(data => {
}); });
``` ```
## sms.hasSmsCapability<sup>7+</sup><a name=sms.hasSmsCapability></a> ## sms.hasSmsCapability<sup>7+</sup>
hasSmsCapability(): boolean hasSmsCapability(): boolean
Checks whether the current device can send and receive SMS messages. This function works in synchronous mode. Checks whether the current device can send and receive SMS messages. This API works in synchronous mode.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
...@@ -307,18 +311,18 @@ let result = sms.hasSmsCapability(); ...@@ -307,18 +311,18 @@ let result = sms.hasSmsCapability();
console.log(`hasSmsCapability: ${JSON.stringify(result)}`); console.log(`hasSmsCapability: ${JSON.stringify(result)}`);
``` ```
## ShortMessage<a name=ShortMessage></a> ## ShortMessage
Defines an SMS message instance. Defines an SMS message instance.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Variable | Type | Description | | Name | Type | Description |
| ------------------------ | --------------------------------------- | ------------------------------------------------------------ | | ------------------------ | --------------------------------------- | ------------------------------------------------------------ |
| hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.| | hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.<br>**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.|
| isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.| | isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.<br>For details, see section 9.2.3.9 in **3GPP TS 23.040**.|
| isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.| | isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.<br>**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.|
| messageClass | [ShortMessageClass](#ShortMessageClass) | SMS message type. | | messageClass | [ShortMessageClass](#shortmessageclass) | SMS message type. |
| pdu | Array&lt;number&gt; | PDU in the SMS message. | | pdu | Array&lt;number&gt; | PDU in the SMS message. |
| protocolId | number | ID of the protocol used for sending SMS messages. | | protocolId | number | ID of the protocol used for sending SMS messages. |
| scAddress | string | Address of the short message service center (SMSC). | | scAddress | string | Address of the short message service center (SMSC). |
...@@ -328,69 +332,69 @@ Defines an SMS message instance. ...@@ -328,69 +332,69 @@ Defines an SMS message instance.
| visibleRawAddress | string | Sender address. | | visibleRawAddress | string | Sender address. |
## ShortMessageClass<a name=ShortMessageClass></a> ## ShortMessageClass
Enumerates SMS message types. SMS message type.
| Variable | Value | Description | **System capability**: SystemCapability.Telephony.SmsMms
| ---------------- | ---- | ------------------------------------------------------------ |
| UNKNOWN | 0 | Unknown type.<br>**System capability**: SystemCapability.Telephony.SmsMms|
| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received.<br>**System capability**: SystemCapability.Telephony.SmsMms|
| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card.<br>**System capability**: SystemCapability.Telephony.SmsMms|
| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.<br>**System capability**: SystemCapability.Telephony.SmsMms|
| FORWARD_MESSAGE | 4 | Message to be forwarded to another device.<br>**System capability**: SystemCapability.Telephony.SmsMms|
| Name | Value | Description |
| ---------------- | ---- | ---------------------------------------- |
| UNKNOWN | 0 | Unknown type. |
| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received. |
| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card. |
| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.|
| FORWARD_MESSAGE | 4 | Message to be forwarded to another device. |
## SendMessageOptions<a name=SendMessageOptions></a>
Provides the options (including callbacks) for sending an SMS message. ## SendMessageOptions
For example, you can specify the SMS message type by the optional parameter **content**. Provides the options (including callbacks) for sending an SMS message. For example, you can specify the SMS message type by the optional parameter **content**.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Parameter | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages. <br>- **0**: card slot 1<br>- **1**: card slot 2 | | slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages. <br>- **0**: card slot 1<br>- **1**: card slot 2 |
| destinationHost | string | Yes | Destination address of the SMS message. | | destinationHost | string | Yes | Destination address of the SMS message. |
| content | string \| Array&lt;number&gt; | Yes | SMS message type. If the content is composed of character strings, the SMS message is a text message. If the content is composed of byte arrays, the SMS message is a data message.| | content | string \| Array&lt;number&gt; | Yes | SMS message type. If the content is composed of character strings, the SMS message is a text message. If the content is composed of byte arrays, the SMS message is a data message.|
| serviceCenter | string | No | SMSC address. By default, the SMSC address in the SIM card is used. | | serviceCenter | string | No | SMSC address. By default, the SMSC address in the SIM card is used. |
| destinationPort | number | No | Destination port of the SMS message. This field is mandatory only for a data message. Otherwise, it is optional. | | destinationPort | number | No | Destination port of the SMS message. This field is mandatory only for a data message. Otherwise, it is optional. |
| sendCallback | AsyncCallback&lt;[ISendShortMessageCallback](#ISendShortMessageCallback)&gt; | No | Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#ISendShortMessageCallback).| | sendCallback | AsyncCallback&lt;[ISendShortMessageCallback](#isendshortmessagecallback)&gt; | No | Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#isendshortmessagecallback).|
| deliveryCallback | AsyncCallback&lt;[IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback)&gt; | No | Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback).| | deliveryCallback | AsyncCallback&lt;[IDeliveryShortMessageCallback](#ideliveryshortmessagecallback)&gt; | No | Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#ideliveryshortmessagecallback).|
## ISendShortMessageCallback<a name=ISendShortMessageCallback></a> ## ISendShortMessageCallback
Provides the callback for the SMS message sending result. It consists of three parts: SMS message sending result, URI for storing the sent SMS message, and whether the SMS message is the last part of a long SMS message. Provides the callback for the SMS message sending result. It consists of three parts: SMS message sending result, URI for storing the sent SMS message, and whether the SMS message is the last part of a long SMS message.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Parameter | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------------- | ---- | ------------------------------------------------------------ | | ---------- | ------------------------------- | ---- | ------------------------------------------------------------ |
| isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| | isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.|
| result | [SendSmsResult](#SendSmsResult) | Yes | SMS message sending result. | | result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. |
| url | string | Yes | URI for storing sent SMS messages. | | url | string | Yes | URI for storing sent SMS messages. |
## IDeliveryShortMessageCallback<a name=IDeliveryShortMessageCallback></a> ## IDeliveryShortMessageCallback
Provides the callback for the SMS message sending result. Return the SMS delivery report. Provides the callback for the SMS message sending result. Return the SMS delivery report.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Parameter| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------- | ---- | -------------- | | ------ | ------------------- | ---- | -------------- |
| pdu | Array&lt;number&gt; | Yes | SMS message delivery report.| | pdu | Array&lt;number&gt; | Yes | SMS message delivery report.|
## SendSmsResult<a name=SendSmsResult></a> ## SendSmsResult
Enumerates SMS message sending results. SMS message sending result.
**System capability**: SystemCapability.Telephony.SmsMms **System capability**: SystemCapability.Telephony.SmsMms
| Parameter | Value | Description | | Name | Value | Description |
| ------------------------------------ | ---- | ------------------------------------------------------ | | ------------------------------------ | ---- | ------------------------------------------------------ |
| SEND_SMS_SUCCESS | 0 | SMS message sent successfully. | | SEND_SMS_SUCCESS | 0 | SMS message sent successfully. |
| SEND_SMS_FAILURE_UNKNOWN | 1 | Failed to send the SMS message due to unknown reasons. | | SEND_SMS_FAILURE_UNKNOWN | 1 | Failed to send the SMS message due to unknown reasons. |
......
# Socket # Socket Connection
>![](public_sys-resources/icon-note.gif) **NOTE:** >![](public_sys-resources/icon-note.gif) **NOTE:**
> >
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
import data from '@ohos.telephony.data'; import data from '@ohos.telephony.data';
``` ```
## data.getDefaultCellularDataSlotId<a name=data.getDefaultCellularDataSlotId-callback></a> ## data.getDefaultCellularDataSlotId
getDefaultCellularDataSlotId(callback: AsyncCallback\<number\>): void getDefaultCellularDataSlotId(callback: AsyncCallback\<number\>): void
Obtains the default SIM card used for mobile data. This function uses an asynchronous callback to return the result. Obtains the default SIM card used for mobile data. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -22,9 +22,9 @@ Obtains the default SIM card used for mobile data. This function uses an asynchr ...@@ -22,9 +22,9 @@ Obtains the default SIM card used for mobile data. This function uses an asynchr
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ------------------------------------------ | | -------- | ----------------------- | ---- | ------------------------------------------ |
| callback | AsyncCallback\<number\> | Yes| Callback used to return the result. <br /> **0**: slot 1 <br/>**1**: slot 2| | callback | AsyncCallback\<number\> | Yes | Callback used to return the result.<br>**0**: card slot 1<br>**1**: card slot 2|
**Example** **Example**
...@@ -34,21 +34,21 @@ data.getDefaultCellularDataSlotId((err, data) => { ...@@ -34,21 +34,21 @@ data.getDefaultCellularDataSlotId((err, data) => {
}); });
``` ```
## data.getDefaultCellularDataSlotId<a name=data.getDefaultCellularDataSlotId-promise></a> ## data.getDefaultCellularDataSlotId
getDefaultCellularDataSlotId(): Promise\<number\> getDefaultCellularDataSlotId(): Promise\<number\>
Obtains the default SIM card used for mobile data. This function uses a promise to return the result. Obtains the default SIM card used for mobile data. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Return value** **Return Value**
| Type| Description| | Type | Description |
| ----------------- | ------------------------------------------------------------ | | ----------------- | ------------------------------------------------------------ |
| Promise\<number\> | Promise used to return the result, wherein: <br />**0**: slot 1 <br/>**1**: slot 2| | Promise\<number\> | Promise used to return the result.<br>**0**: card slot 1<br>**1**: card slot 2|
**Example** **Example**
...@@ -61,19 +61,19 @@ promise.then((data) => { ...@@ -61,19 +61,19 @@ promise.then((data) => {
}); });
``` ```
## data.getCellularDataFlowType<a name=data.getCellularDataFlowType-callback></a> ## data.getCellularDataFlowType
getCellularDataFlowType(callback: AsyncCallback\<DataFlowType\>): void getCellularDataFlowType(callback: AsyncCallback\<DataFlowType\>): void
Obtains the cellular data flow type, which can be uplink or downlink. This function uses an asynchronous callback to return the result. Obtains the cellular data flow type, which can be uplink or downlink. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | ---------- | | -------- | ---------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[DataFlowType](#DataFlowType)\> | Yes| Callback used to return the result.| | callback | AsyncCallback\<[DataFlowType](#dataflowtype)\> | Yes | Callback used to return the result.|
**Example** **Example**
...@@ -83,19 +83,19 @@ data.getCellularDataFlowType((err, data) => { ...@@ -83,19 +83,19 @@ data.getCellularDataFlowType((err, data) => {
}); });
``` ```
## data.getCellularDataFlowType<a name=data.getCellularDataFlowType-promise></a> ## data.getCellularDataFlowType
getCellularDataFlowType(): Promise\<DataFlowType\> getCellularDataFlowType(): Promise\<DataFlowType\>
Obtains the cellular data flow type, which can be uplink or downlink. This function uses a promise to return the result. Obtains the cellular data flow type, which can be uplink or downlink. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Return value** **Return Value**
| Type| Description| | Type | Description |
| ---------------------------------------- | ----------------------------------------------- | | ---------------------------------------- | ----------------------------------------------- |
| Promise\<[DataFlowType](#DataFlowType)\> | Promise used to return the result. | | Promise\<[DataFlowType](#dataflowtype)\> | Promise used to return the result. |
**Example** **Example**
...@@ -108,19 +108,19 @@ promise.then((data) => { ...@@ -108,19 +108,19 @@ promise.then((data) => {
}); });
``` ```
## data.getCellularDataState<a name=data.getCellularDataState-callback></a> ## data.getCellularDataState
getCellularDataState(callback: AsyncCallback\<DataConnectState\>): void getCellularDataState(callback: AsyncCallback\<DataConnectState\>): void
Obtains the connection status of the packet switched (PS) domain. This function uses an asynchronous callback to return the result. Obtains the connection status of the packet switched (PS) domain. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------ | ---- | ---------- | | -------- | ------------------------------------------------------ | ---- | ---------- |
| callback | AsyncCallback\<[DataConnectState](#DataConnectState)\> | Yes| Callback used to return the result.| | callback | AsyncCallback\<[DataConnectState](#dataconnectstate)\> | Yes | Callback used to return the result.|
**Example** **Example**
...@@ -130,19 +130,19 @@ data.getCellularDataState((err, data) => { ...@@ -130,19 +130,19 @@ data.getCellularDataState((err, data) => {
}); });
``` ```
## data.getCellularDataState<a name=data.getCellularDataState-promise></a> ## data.getCellularDataState
getCellularDataState(): Promise\<DataConnectState\> getCellularDataState(): Promise\<DataConnectState\>
Obtains the connection status of the PS domain. This function uses a promise to return the result. Obtains the connection status of the PS domain. This API uses a promise to return the result.
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Return value** **Return Value**
| Type| Description| | Type | Description |
| ------------------------------------------------ | ------------------------------------- | | ------------------------------------------------ | ------------------------------------- |
| Promise\<[DataConnectState](#DataConnectState)\> | Promise used to return the result.| | Promise\<[DataConnectState](#dataconnectstate)\> | Promise used to return the result.|
**Example** **Example**
...@@ -155,11 +155,11 @@ promise.then((data) => { ...@@ -155,11 +155,11 @@ promise.then((data) => {
}); });
``` ```
## data.isCellularDataEnabled<a name=data.isCellularDataEnabled-callback></a> ## data.isCellularDataEnabled
isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void isCellularDataEnabled(callback: AsyncCallback\<boolean\>): void
Checks whether the cellular data service is enabled. This function uses an asynchronous callback to return the result. Checks whether the cellular data service is enabled. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -167,9 +167,9 @@ Checks whether the cellular data service is enabled. This function uses an async ...@@ -167,9 +167,9 @@ Checks whether the cellular data service is enabled. This function uses an async
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br />**true**: The cellular data service is enabled. <br />**false**: The cellular data service is disabled.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.|
**Example** **Example**
...@@ -179,21 +179,21 @@ data.isCellularDataEnabled((err, data) => { ...@@ -179,21 +179,21 @@ data.isCellularDataEnabled((err, data) => {
}); });
``` ```
## data.isCellularDataEnabled<a name=data.isCellularDataEnabled-promise></a> ## data.isCellularDataEnabled
isCellularDataEnabled(): Promise\<boolean\> isCellularDataEnabled(): Promise\<boolean\>
Checks whether the cellular data service is enabled. This function uses a promise to return the result. Checks whether the cellular data service is enabled. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
**System capability**: SystemCapability.Telephony.CellularData **System capability**: SystemCapability.Telephony.CellularData
**Return value** **Return Value**
| Type| Description| | Type | Description |
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result, wherein: <br />**true**: The cellular data service is enabled. <br />**false**: The cellular data service is disabled.| | Promise\<boolean\> | Promise used to return the result.<br>**true**: The cellular data service is enabled.<br>**false**: The cellular data service is disabled.|
**Example** **Example**
...@@ -206,11 +206,11 @@ promise.then((data) => { ...@@ -206,11 +206,11 @@ promise.then((data) => {
}); });
``` ```
## data.isCellularDataRoamingEnabled<a name=data.isCellularDataRoamingEnabled-callback></a> ## data.isCellularDataRoamingEnabled
isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>): void isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\<boolean\>): void
Checks whether roaming is enabled for the cellular data service. This function uses an asynchronous callback to return the result. Checks whether roaming is enabled for the cellular data service. This API uses an asynchronous callback to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -218,10 +218,10 @@ Checks whether roaming is enabled for the cellular data service. This function u ...@@ -218,10 +218,10 @@ Checks whether roaming is enabled for the cellular data service. This function u
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------ | ---- | ------------------------------------------------------------ |
| slotId | number | Yes| Card slot ID. The options are as follows: <br />**0**: slot 1 <br />**1**: slot 2| | slotId | number | Yes | Card slot ID. <br>**0**: card slot 1<br>**1**: card slot 2 |
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br />**true**: Roaming is enabled for the cellular data service. <br />**false**: Roaming is disabled for the cellular data service.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.|
**Example** **Example**
...@@ -231,11 +231,11 @@ data.isCellularDataRoamingEnabled(0,(err, data) => { ...@@ -231,11 +231,11 @@ data.isCellularDataRoamingEnabled(0,(err, data) => {
}); });
``` ```
## data.isCellularDataRoamingEnabled<a name=data.isCellularDataRoamingEnabled-promise></a> ## data.isCellularDataRoamingEnabled
isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\> isCellularDataRoamingEnabled(slotId: number): Promise\<boolean\>
Checks whether roaming is enabled for the cellular data service. This method uses a promise to return the result. Checks whether roaming is enabled for the cellular data service. This API uses a promise to return the result.
**Required permission**: ohos.permission.GET_NETWORK_INFO **Required permission**: ohos.permission.GET_NETWORK_INFO
...@@ -243,15 +243,15 @@ Checks whether roaming is enabled for the cellular data service. This method use ...@@ -243,15 +243,15 @@ Checks whether roaming is enabled for the cellular data service. This method use
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------------------- | | ------ | ------ | ---- | ---------------------------------------- |
| slotId | number | Yes| Card slot ID. The options are as follows: <br />**0**: slot 1 <br/>**1**: slot 2| | slotId | number | Yes | Card slot ID. <br>**0**: card slot 1<br>**1**: card slot 2|
**Return value** **Return Value**
| Type| Description| | Type | Description |
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<boolean\> | Promise used to return the result, wherein: <br />**true**: Roaming is enabled for the cellular data service. <br />**false**: Roaming is disabled for the cellular data service.| | Promise\<boolean\> | Promise used to return the result.<br>**true**: Roaming is enabled for the cellular data service.<br>**false**: Roaming is disabled for the cellular data service.|
**Example** **Example**
...@@ -264,26 +264,30 @@ promise.then((data) => { ...@@ -264,26 +264,30 @@ promise.then((data) => {
}); });
``` ```
## DataFlowType<a name=DataFlowType></a> ## DataFlowType
Defines the cellular data flow type. Defines the cellular data flow type.
| Name| Value| Description| **System capability**: SystemCapability.Telephony.CellularData
| ------ | ---------------------- | ------------------------------------------------------------ |
| 0 | DATA_FLOW_TYPE_NONE | No uplink or downlink data is available. <br />**System capability**: SystemCapability.Telephony.CellularData| | Name | Value | Description |
| 1 | DATA_FLOW_TYPE_DOWN | Only the downlink data is available. <br />**System capability**: SystemCapability.Telephony.CellularData| | ---------------------- | ---- | ------------------------------------------ |
| 2 | DATA_FLOW_TYPE_UP | Only the uplink data is available. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_FLOW_TYPE_NONE | 0 | No uplink or downlink data is available. |
| 3 | DATA_FLOW_TYPE_UP_DOWN | Both uplink data and downlink data are available. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_FLOW_TYPE_DOWN | 1 | Only the downlink data is available. |
| 4 | DATA_FLOW_TYPE_DORMANT | No uplink or downlink data is available because the lower-layer link is in the dormant state. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_FLOW_TYPE_UP | 2 | Only the uplink data is available. |
| DATA_FLOW_TYPE_UP_DOWN | 3 | Both uplink data and downlink data are available. |
| DATA_FLOW_TYPE_DORMANT | 4 | No uplink or downlink data is available because the lower-layer link is in the dormant state.|
## DataConnectState<a name=DataConnectState></a> ## DataConnectState
Describes the connection status of a cellular data link. Describes the connection status of a cellular data link.
**System capability**: SystemCapability.Telephony.CellularData
| Name| Value| Description| | Name | Value | Description |
| ------ | ----------------------- | ------------------------------------------------------------ | | ----------------------- | ---- | -------------------------- |
| -1 | DATA_STATE_UNKNOWN| The status of the cellular data link is unknown. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_STATE_UNKNOWN | -1 | The status of the cellular data link is unknown. |
| 0 | DATA_STATE_DISCONNECTED | The cellular data link is disconnected. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_STATE_DISCONNECTED | 0 | The cellular data link is disconnected. |
| 1 | DATA_STATE_CONNECTING | The cellular data link is being connected. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_STATE_CONNECTING | 1 | The cellular data link is being connected.|
| 2 | DATA_STATE_CONNECTED | The cellular data link is connected. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_STATE_CONNECTED | 2 | The cellular data link is connected. |
| 3 | DATA_STATE_SUSPENDED | The cellular data link is suspended. <br />**System capability**: SystemCapability.Telephony.CellularData| | DATA_STATE_SUSPENDED | 3 | The cellular data link is suspended. |
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The Thermal Manager module provides APIs for listening to the device thermal status. This module provides thermal level-related callback and query APIs to obtain the information required for thermal control.
## Modules to Import ## Modules to Import
...@@ -17,15 +17,17 @@ import thermal from '@ohos.thermal'; ...@@ -17,15 +17,17 @@ import thermal from '@ohos.thermal';
Represents the thermal level. Represents the thermal level.
**System capability:** SystemCapability.PowerManager.ThermalManager
| Name | Default Value | Description | | Name | Default Value | Description |
| ---------- | ---- | ---------------------------------------- | | ---------- | ---- | ---------------------------------------- |
| COOL | 0 | The device is cool, and services are not restricted.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | COOL | 0 | The device is cool, and services are not restricted.|
| NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.|
| WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.|
| HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.|
| OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.|
| WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.|
| EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.<br>**System capability:** SystemCapability.PowerManager.ThermalManager| | EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.|
## thermal.subscribeThermalLevel ## thermal.subscribeThermalLevel
......
# WebSocket # WebSocket Connection
>![](public_sys-resources/icon-note.gif) **NOTE:** >![](public_sys-resources/icon-note.gif) **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. >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.
......
...@@ -3,547 +3,515 @@ ...@@ -3,547 +3,515 @@
- [Application Development Overview](application-dev-guide.md) - [Application Development Overview](application-dev-guide.md)
- Quick Start - Quick Start
- [Getting Started with Application Development](quick-start/Readme-EN.md) - [Getting Started with Application Development](quick-start/Readme-EN.md)
- [DevEco Studio \(OpenHarmony\) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md) - DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md) - [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md) - [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md)
- [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [Directory Structure](quick-start/package-structure.md)
- Development
- [UI](ui/Readme-EN.md)
- JavaScript-based Web-Like Development Paradigm
- [Overview](ui/ui-js-overview.md)
- Framework
- [File Organization](ui/js-framework-file.md)
- ["js" Tag](ui/js-framework-js-tag.md)
- [app.js](ui/js-framework-js-file.md)
- Syntax
- [HML](ui/js-framework-syntax-hml.md)
- [CSS](ui/js-framework-syntax-css.md)
- [JavaScript](ui/js-framework-syntax-js.md)
- [Lifecycle](ui/js-framework-lifecycle.md)
- [Resource Limitations and Access](ui/js-framework-resource-restriction.md)
- [Multi-Language Capability](ui/js-framework-multiple-languages.md)
- Building the UI
- [Component Overview](ui/ui-js-building-ui-component.md)
- Building the Layout
- [Layout Description](ui/ui-js-building-ui-layout-intro.md)
- [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md)
- [Adding an Image](ui/ui-js-building-ui-layout-image.md)
- [Adding a Comment](ui/ui-js-building-ui-layout-comment.md)
- [Adding a Container](ui/ui-js-building-ui-layout-external-container.md)
- [Adding Interactions](ui/ui-js-building-ui-interactions.md)
- [Developing Animations](ui/ui-js-building-ui-animation.md)
- [Defining Events](ui/ui-js-building-ui-event.md)
- [Defining Page Routes](ui/ui-js-building-ui-routes.md)
- Common Component Development Guidelines
- [Text](ui/ui-js-components-text.md)
- [Input](ui/ui-js-components-input.md)
- [Button](ui/ui-js-components-button.md)
- [List](ui/ui-js-components-list.md)
- [Picker](ui/ui-js-components-picker.md)
- [Dialog](ui/ui-js-components-dialog.md)
- [Form](ui/ui-js-components-form.md)
- [Stepper](ui/ui-js-components-stepper.md)
- [Tabs](ui/ui-js-component-tabs.md)
- [Image](ui/ui-js-components-images.md)
- Animation Development Guidelines
- CSS Animation
- [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md)
- [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md)
- [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md)
- JS Animation
- [Component Animation](ui/ui-js-animate-component.md)
- Interpolator Animation
- [Animation Effect](ui/ui-js-animate-dynamic-effects.md)
- [Animation Frame](ui/ui-js-animate-frame.md)
- [Custom Components](ui/ui-js-custom-components.md)
- TypeScript-based Declarative Development Paradigm
- [Overview](ui/ui-ts-overview.md)
- Framework Overview
- File Organization
- [Directory Structure](ui/ts-framework-directory.md)
- [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md)
- ["js" Tag](ui/ts-framework-js-tag.md)
- Resource Access
- [Media Resource Types](ui/ts-media-resource-type.md)
- [Pixel Units](ui/ts-pixel-units.md)
- [Types](ui/ts-types.md)
- Declarative Syntax
- [Overview](ui/ts-syntax-intro.md)
- General UI Description Specifications
- [Basic Concepts](ui/ts-general-ui-concepts.md)
- Declarative UI Description Specifications
- [Parameterless Configuration](ui/ts-parameterless-configuration.md)
- [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md)
- [Attribution Configuration](ui/ts-attribution-configuration.md)
- [Event Configuration](ui/ts-event-configuration.md)
- [Child Component Configuration](ui/ts-child-component-configuration.md)
- Componentization
- [@Component](ui/ts-component-based-component.md)
- [@Entry](ui/ts-component-based-entry.md)
- [@Preview](ui/ts-component-based-preview.md)
- [@Builder](ui/ts-component-based-builder.md)
- [@Extend](ui/ts-component-based-extend.md)
- [@CustomDialog](ui/ts-component-based-customdialog.md)
- About UI State Management
- [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md)
- Managing Component States
- [@State](ui/ts-component-states-state.md)
- [@Prop](ui/ts-component-states-prop.md)
- [@Link](ui/ts-component-states-link.md)
- Managing Application States
- [AppStorage](ui/ts-application-states-appstorage.md)
- [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md)
- [Environment](ui/ts-application-states-apis-environment.md)
- Managing Other States
- [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md)
- [@Consume and @Provide](ui/ts-other-states-consume-provide.md)
- [@Watch](ui/ts-other-states-watch.md)
- About Rendering Control Syntax
- [if/else](ui/ts-rending-control-syntax-if-else.md)
- [ForEach](ui/ts-rending-control-syntax-foreach.md)
- [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md)
- About @Component
- [build Function](ui/ts-function-build.md)
- [Custom Component Initialization](ui/ts-custom-component-initialization.md)
- [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md)
- [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md)
- [Syntactic Sugar](ui/ts-syntactic-sugar.md)
- Experiencing the Declarative UI
- [Creating a Declarative UI Project](ui/ui-ts-creating-project.md)
- [Getting to Know Components](ui/ui-ts-components.md)
- [Creating a Simple Page](ui/ui-ts-creating-simple-page.md)
- Defining Page Layout and Connection
- [Building a Food Data Model](ui/ui-ts-building-data-model.md)
- [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md)
- [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md)
- [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md)
- Basic Functions
- [Agent-Powered Scheduled Reminders ](background-agent-scheduled-reminder/Readme-EN.md)
- [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md)
- [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md)
- [Background Task Management ](background-task-management/Readme-EN.md)
- [Background Task Management Overview](background-task-management/background-task-overview.md)
- [Background Task Management Development](background-task-management/background-task-dev-guide.md)
- [WebGL](webgl/Readme-EN.md)
- [WebGL Overview](webgl/webgl-overview.md)
- [WebGL Development](webgl/webgl-guidelines.md)
- [Media](media/Readme-EN.md)
- Audio
- [Audio Overview](media/audio-overview.md)
- [Audio Playback Development](media/audio-playback.md)
- [Audio Playback Development Using AudioRenderer](media/audio-renderer.md)
- [Audio Management Development](media/audio-management.md)
- [Audio Recording Development](media/audio-recorder.md)
- [Audio Recorder Development Using AudioCapturer](media/audio-capturer)
- Video
- [Video Playback Development](media/video-playback.md)
- [Video Recording Development](media/video-recorder.md)
- [Security](security/Readme-EN.md)
- User Authentication
- [User Authentication Overview](security/userauth-overview.md)
- [User Authentication Development](security/userauth-guidelines.md)
- [Connectivity](connectivity/Readme-EN.md)
- [IPC & RPC](connectivity/ipc-rpc.md)
- [IPC & RPC Overview](connectivity/ipc-rpc-overview.md)
- [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md)
- [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md)
- [Data Management](database/Readme-EN.md)
- Distributed Data Service
- [Distributed Data Service Overview](database/database-mdds-overview.md)
- [Distributed Data Service Development](database/database-mdds-guidelines.md)
- Relational Database Overview
- [RDB Overview](database/database-relational-overview.md)
- [RDB Development](database/database-relational-guidelines.md)
- Lightweight Data Store
- [Lightweight Data Store Overview](database/database-preference-overview.md)
- [Lightweight Data Store Development](database/database-preference-guidelines.md)
- [Device](device/Readme-EN.md)
- USB Service
- [USB Service Overview](device/usb-overview.md)
- [USB Service Development](device/usb-guidelines.md)
- Location
- [Location Overview](device/device-location-overview.md)
- [Obtaining Device Location Information](device/device-location-info.md)
- [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md)
- [DFX](dfx/Readme-EN.md)
- Application Event Logging
- [Overview of Application Event Logging](dfx/hiappevent-overview.md)
- [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md)
- Tools
- [DevEco Studio \(OpenHarmony\) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md)
- [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- Hands-On Tutorials - [Directory Structure](quick-start/package-structure.md)
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) - Development
- API References - UI
- [Compent Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md) - JavaScript-based Web-Like Development Paradigm
- [Components](reference/arkui-js/js-components.md) - [Overview](ui/ui-js-overview.md)
- [Common](reference/arkui-js/js-components-common.md) - Framework
- [Universal Attributes](reference/arkui-js/js-components-common-attributes.md) - [File Organization](ui/js-framework-file.md)
- [Universal Styles](reference/arkui-js/js-components-common-styles.md) - ["js" Tag](ui/js-framework-js-tag.md)
- [Universal Events](reference/arkui-js/js-components-common-events.md) - [app.js](ui/js-framework-js-file.md)
- [Universal Methods](reference/arkui-js/js-components-common-methods.md) - Syntax
- [Animation Styles](reference/arkui-js/js-components-common-animation.md) - [HML](ui/js-framework-syntax-hml.md)
- [Gradient Styles](reference/arkui-js/js-components-common-gradient.md) - [CSS](ui/js-framework-syntax-css.md)
- [Transition Styles](reference/arkui-js/js-components-common-transition.md) - [JavaScript](ui/js-framework-syntax-js.md)
- [Media Query](reference/arkui-js/js-components-common-mediaquery.md) - [Lifecycle](ui/js-framework-lifecycle.md)
- [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md) - [Resource Limitations and Access](ui/js-framework-resource-restriction.md)
- [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md) - [Multi-Language Capability](ui/js-framework-multiple-languages.md)
- Building the UI
- [Container Component](reference/arkui-js/js-components-container.md) - [Component Overview](ui/ui-js-building-ui-component.md)
- [badge](reference/arkui-js/js-components-container-badge.md) - Building the Layout
- [dialog](reference/arkui-js/js-components-container-dialog.md) - [Layout Description](ui/ui-js-building-ui-layout-intro.md)
- [div](reference/arkui-js/js-components-container-div.md) - [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md)
- [form](reference/arkui-js/js-components-container-form.md) - [Adding an Image](ui/ui-js-building-ui-layout-image.md)
- [list](reference/arkui-js/js-components-container-list.md) - [Adding a Comment](ui/ui-js-building-ui-layout-comment.md)
- [list-item](reference/arkui-js/js-components-container-list-item.md) - [Adding a Container](ui/ui-js-building-ui-layout-external-container.md)
- [list-item-group](reference/arkui-js/js-components-container-list-item-group.md) - [Adding Interactions](ui/ui-js-building-ui-interactions.md)
- [panel](reference/arkui-js/js-components-container-panel.md) - [Developing Animations](ui/ui-js-building-ui-animation.md)
- [popup](reference/arkui-js/js-components-container-popup.md) - [Defining Events](ui/ui-js-building-ui-event.md)
- [refresh](reference/arkui-js/js-components-container-refresh.md) - [Defining Page Routes](ui/ui-js-building-ui-routes.md)
- [stack](reference/arkui-js/js-components-container-stack.md) - Common Component Development Guidelines
- [stepper](reference/arkui-js/js-components-container-stepper.md) - [Text](ui/ui-js-components-text.md)
- [stepper-item](reference/arkui-js/js-components-container-stepper-item.md) - [Input](ui/ui-js-components-input.md)
- [swiper](reference/arkui-js/js-components-container-swiper.md) - [Button](ui/ui-js-components-button.md)
- [tabs](reference/arkui-js/js-components-container-tabs.md) - [List](ui/ui-js-components-list.md)
- [tab-bar](reference/arkui-js/js-components-container-tab-bar.md) - [Picker](ui/ui-js-components-picker.md)
- [tab-content](reference/arkui-js/js-components-container-tab-content.md) - [Dialog](ui/ui-js-components-dialog.md)
- [Form](ui/ui-js-components-form.md)
- [Basic Components](reference/arkui-js/js-components-basic.md) - [Stepper](ui/ui-js-components-stepper.md)
- [button](reference/arkui-js/js-components-basic-button.md) - [Tabs](ui/ui-js-component-tabs.md)
- [chart](reference/arkui-js/js-components-basic-chart.md) - [Image](ui/ui-js-components-images.md)
- [divider](reference/arkui-js/js-components-basic-divider.md) - Animation Development Guidelines
- [image](reference/arkui-js/js-components-basic-image.md) - CSS Animation
- [image-animator](reference/arkui-js/js-components-basic-image-animator.md) - [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md)
- [input](reference/arkui-js/js-components-basic-input.md) - [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md)
- [label](reference/arkui-js/js-components-basic-label.md) - [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md)
- [marquee](reference/arkui-js/js-components-basic-marquee.md) - JS Animation
- [menu](reference/arkui-js/js-components-basic-menu.md) - [Component Animation](ui/ui-js-animate-component.md)
- [option](reference/arkui-js/js-components-basic-option.md) - Interpolator Animation
- [picker](reference/arkui-js/js-components-basic-picker.md) - [Animation Effect](ui/ui-js-animate-dynamic-effects.md)
- [picker-view](reference/arkui-js/js-components-basic-picker-view.md) - [Animation Frame](ui/ui-js-animate-frame.md)
- [piece](reference/arkui-js/js-components-basic-piece.md) - [Custom Components](ui/ui-js-custom-components.md)
- [progress](reference/arkui-js/js-components-basic-progress.md) - TypeScript-based Declarative Development Paradigm
- [qrcode](reference/arkui-js/js-components-basic-qrcode.md) - [Overview](ui/ui-ts-overview.md)
- [rating](reference/arkui-js/js-components-basic-rating.md) - Framework Overview
- [richtext](reference/arkui-js/js-components-basic-richtext.md) - File Organization
- [search](reference/arkui-js/js-components-basic-search.md) - [Directory Structure](ui/ts-framework-directory.md)
- [select](reference/arkui-js/js-components-basic-select.md) - [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md)
- [slider](reference/arkui-js/js-components-basic-slider.md) - ["js" Tag](ui/ts-framework-js-tag.md)
- [span](reference/arkui-js/js-components-basic-span.md) - Resource Access
- [switch](reference/arkui-js/js-components-basic-switch.md) - [Media Resource Types](ui/ts-media-resource-type.md)
- [text](reference/arkui-js/js-components-basic-text.md) - [Pixel Units](ui/ts-pixel-units.md)
- [textarea](reference/arkui-js/js-components-basic-textarea.md) - [Types](ui/ts-types.md)
- [toolbar](reference/arkui-js/js-components-basic-toolbar.md) - Declarative Syntax
- [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md) - [Overview](ui/ts-syntax-intro.md)
- [toggle](reference/arkui-js/js-components-basic-toggle.md) - General UI Description Specifications
- [Basic Concepts](ui/ts-general-ui-concepts.md)
- [Media Components](reference/arkui-js/js-components-media.md) - Declarative UI Description Specifications
- [video](reference/arkui-js/js-components-media-video.md) - [Parameterless Configuration](ui/ts-parameterless-configuration.md)
- [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md)
- [Canvas Components](reference/arkui-js/js-components-canvas.md) - [Attribution Configuration](ui/ts-attribution-configuration.md)
- [canvas](reference/arkui-js/js-components-canvas-canvas.md) - [Event Configuration](ui/ts-event-configuration.md)
- [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md) - [Child Component Configuration](ui/ts-child-component-configuration.md)
- [Image](reference/arkui-js/js-components-canvas-image.md) - Componentization
- [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md) - [@Component](ui/ts-component-based-component.md)
- [ImageData](reference/arkui-js/js-components-canvas-imagedata.md) - [@Entry](ui/ts-component-based-entry.md)
- [Path2D](reference/arkui-js/js-components-canvas-path2d.md) - [@Preview](ui/ts-component-based-preview.md)
- [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md) - [@Builder](ui/ts-component-based-builder.md)
- [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md) - [@Extend](ui/ts-component-based-extend.md)
- [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md) - [@CustomDialog](ui/ts-component-based-customdialog.md)
- About UI State Management
- [Grid](reference/arkui-js/js-components-grid.md) - [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md)
- [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md) - Managing Component States
- [grid-container](reference/arkui-js/js-components-grid-container.md) - [@State](ui/ts-component-states-state.md)
- [grid-row](reference/arkui-js/js-components-grid-row.md) - [@Prop](ui/ts-component-states-prop.md)
- [grid-col](reference/arkui-js/js-components-grid-col.md) - [@Link](ui/ts-component-states-link.md)
- Managing Application States
- [SVG Components](reference/arkui-js/js-svg.md) - [AppStorage](ui/ts-application-states-appstorage.md)
- [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md) - [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md)
- [svg](reference/arkui-js/js-components-svg.md) - [Environment](ui/ts-application-states-apis-environment.md)
- [rect](reference/arkui-js/js-components-svg-rect.md) - Managing Other States
- [circle](reference/arkui-js/js-components-svg-circle.md) - [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md)
- [ellipse](reference/arkui-js/js-components-svg-ellipse.md) - [@Consume and @Provide](ui/ts-other-states-consume-provide.md)
- [path](reference/arkui-js/js-components-svg-path.md) - [@Watch](ui/ts-other-states-watch.md)
- [line](reference/arkui-js/js-components-svg-line.md) - About Rendering Control Syntax
- [polyline](reference/arkui-js/js-components-svg-polyline.md) - [if/else](ui/ts-rending-control-syntax-if-else.md)
- [polygon](reference/arkui-js/js-components-svg-polygon.md) - [ForEach](ui/ts-rending-control-syntax-foreach.md)
- [text](reference/arkui-js/js-components-svg-text.md) - [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md)
- [tspan](reference/arkui-js/js-components-svg-tspan.md) - About @Component
- [textPath](reference/arkui-js/js-components-svg-textpath.md) - [build Function](ui/ts-function-build.md)
- [animate](reference/arkui-js/js-components-svg-animate.md) - [Custom Component Initialization](ui/ts-custom-component-initialization.md)
- [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md) - [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md)
- [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md) - [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md)
- [Syntactic Sugar](ui/ts-syntactic-sugar.md)
- [Custom Components](reference/arkui-js/js-components-custom.md) - Experiencing the Declarative UI
- [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md) - [Creating a Declarative UI Project](ui/ui-ts-creating-project.md)
- [Custom Events](reference/arkui-js/js-components-custom-events.md) - [Getting to Know Components](ui/ui-ts-components.md)
- [props](reference/arkui-js/js-components-custom-props.md) - [Creating a Simple Page](ui/ui-ts-creating-simple-page.md)
- [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md) - Defining Page Layout and Connection
- [slot](reference/arkui-js/js-components-custom-slot.md) - [Building a Food Data Model](ui/ui-ts-building-data-model.md)
- [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md) - [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md)
- [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md)
- [Appendix](reference/arkui-js/js-appendix.md) - [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md)
- [Type Attributes](reference/arkui-js/js-appendix-types.md) - Basic Functions
- [Compent Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md) - Agent-Powered Scheduled Reminders
- [Components](reference/arkui-ts/ts-components.md) - [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md)
- [Universal Components](reference/arkui-ts/ts-universal-components.md) - [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md)
- [Universal Events](reference/arkui-ts/ts-universal-events.md) - Background Task Management
- [Click Event](reference/arkui-ts/ts-universal-events-click.md) - [Background Task Management Overview](background-task-management/background-task-overview.md)
- [Touch](reference/arkui-ts/ts-universal-events-touch.md) - [Background Task Management Development](background-task-management/background-task-dev-guide.md)
- [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md) - WebGL
- [Key Event](reference/arkui-ts/ts-universal-events-key.md) - [WebGL Overview](webgl/webgl-overview.md)
- [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md) - [WebGL Development](webgl/webgl-guidelines.md)
- Media
- [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md) - Audio
- [Size](reference/arkui-ts/ts-universal-attributes-size.md) - [Audio Overview](media/audio-overview.md)
- [Location](reference/arkui-ts/ts-universal-attributes-location.md) - [Audio Playback Development](media/audio-playback.md)
- [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md) - [Audio Playback Development Using AudioRenderer](media/audio-renderer.md)
- [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md) - [Audio Recording Development](media/audio-recorder.md)
- [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md) - [Audio Recorder Development Using AudioCapturer](media/audio-capturer)
- [Background](reference/arkui-ts/ts-universal-attributes-background.md) - Video
- [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md) - [Video Playback Development](media/video-playback.md)
- [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md) - [Video Recording Development](media/video-recorder.md)
- [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md) - Security
- [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md) - User Authentication
- [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md) - [User Authentication Overview](security/userauth-overview.md)
- [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md) - [User Authentication Development](security/userauth-guidelines.md)
- [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md) - Connectivity
- [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md) - IPC & RPC
- [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md) - [IPC & RPC Overview](connectivity/ipc-rpc-overview.md)
- [Grid](reference/arkui-ts/ts-universal-attributes-grid.md) - [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md)
- [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md) - [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md)
- [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md) - Data Management
- [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md) - Distributed Data Service
- [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md) - [Distributed Data Service Overview](database/database-mdds-overview.md)
- [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md) - [Distributed Data Service Development](database/database-mdds-guidelines.md)
- Relational Database Overview
- [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md) - [RDB Overview](database/database-relational-overview.md)
- [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md) - [RDB Development](database/database-relational-guidelines.md)
- [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md) - Lightweight Data Store
- [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md) - [Lightweight Data Store Overview](database/database-preference-overview.md)
- [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md) - [Lightweight Data Store Development](database/database-preference-guidelines.md)
- [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md) - Device
- [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md) - USB Service
- [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md) - [USB Service Overview](device/usb-overview.md)
- [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md) - [USB Service Development](device/usb-guidelines.md)
- Location
- [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md) - [Location Overview](device/device-location-overview.md)
- [Obtaining Device Location Information](device/device-location-info.md)
- [Basic Components](reference/arkui-ts/ts-basic-components.md) - [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md)
- [Blank](reference/arkui-ts/ts-basic-components-blank.md) - DFX
- [Button](reference/arkui-ts/ts-basic-components-button.md) - Application Event Logging
- [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) - [Overview of Application Event Logging](dfx/hiappevent-overview.md)
- [Divider](reference/arkui-ts/ts-basic-components-divider.md) - [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md)
- [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) - Tools
- [Image](reference/arkui-ts/ts-basic-components-image.md) - DevEco Studio (OpenHarmony) User Guide
- [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) - [Overview](quick-start/deveco-studio-overview.md)
- [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md) - [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Marquee](reference/arkui-ts/ts-basic-components-marquee.md) - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Progress](reference/arkui-ts/ts-basic-components-progress.md) - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md) - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Rating](reference/arkui-ts/ts-basic-components-rating.md) - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [Select](reference/arkui-ts/ts-basic-components-select.md) - Hands-On Tutorials
- [Slider](reference/arkui-ts/ts-basic-components-slider.md) - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- [Span](reference/arkui-ts/ts-basic-components-span.md) - API References
- [Text](reference/arkui-ts/ts-basic-components-text.md) - Compent Reference (JavaScript-based Web-like Development Paradigm)
- [TextArea](reference/arkui-ts/ts-basic-components-textarea.md) - [Components](reference/arkui-js/js-components.md)
- [TextInput](reference/arkui-ts/ts-basic-components-textinput.md) - [Common](reference/arkui-js/js-components-common.md)
- [Toggle](reference/arkui-ts/ts-basic-components-toggle.md) - [Universal Attributes](reference/arkui-js/js-components-common-attributes.md)
- [TextClock](reference/arkui-ts/ts-basic-components-textclock.md) - [Universal Styles](reference/arkui-js/js-components-common-styles.md)
- [Universal Events](reference/arkui-js/js-components-common-events.md)
- [Container Components](reference/arkui-ts/ts-components-container.md) - [Universal Methods](reference/arkui-js/js-components-common-methods.md)
- [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md) - [Animation Styles](reference/arkui-js/js-components-common-animation.md)
- [Badge](reference/arkui-ts/ts-container-badge.md) - [Gradient Styles](reference/arkui-js/js-components-common-gradient.md)
- [Column](reference/arkui-ts/ts-container-column.md) - [Transition Styles](reference/arkui-js/js-components-common-transition.md)
- [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md) - [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md)
- [Counter](reference/arkui-ts/ts-container-counter.md) - [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md)
- [Flex](reference/arkui-ts/ts-container-flex.md) - [Container Component](reference/arkui-js/js-components-container.md)
- [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md) - [badge](reference/arkui-js/js-components-container-badge.md)
- [Grid](reference/arkui-ts/ts-container-grid.md) - [dialog](reference/arkui-js/js-components-container-dialog.md)
- [GridItem](reference/arkui-ts/ts-container-griditem.md) - [div](reference/arkui-js/js-components-container-div.md)
- [List](reference/arkui-ts/ts-container-list.md) - [form](reference/arkui-js/js-components-container-form.md)
- [ListItem](reference/arkui-ts/ts-container-listitem.md) - [list](reference/arkui-js/js-components-container-list.md)
- [Navigator](reference/arkui-ts/ts-container-navigator.md) - [list-item](reference/arkui-js/js-components-container-list-item.md)
- [Navigation](reference/arkui-ts/ts-container-navigation.md) - [list-item-group](reference/arkui-js/js-components-container-list-item-group.md)
- [Panel](reference/arkui-ts/ts-container-panel.md) - [panel](reference/arkui-js/js-components-container-panel.md)
- [Row](reference/arkui-ts/ts-container-row.md) - [popup](reference/arkui-js/js-components-container-popup.md)
- [RowSplit](reference/arkui-ts/ts-container-rowsplit.md) - [refresh](reference/arkui-js/js-components-container-refresh.md)
- [Scroll](reference/arkui-ts/ts-container-scroll.md) - [stack](reference/arkui-js/js-components-container-stack.md)
- [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md) - [stepper](reference/arkui-js/js-components-container-stepper.md)
- [Stack](reference/arkui-ts/ts-container-stack.md) - [stepper-item](reference/arkui-js/js-components-container-stepper-item.md)
- [Swiper](reference/arkui-ts/ts-container-swiper.md) - [swiper](reference/arkui-js/js-components-container-swiper.md)
- [Tabs](reference/arkui-ts/ts-container-tabs.md) - [tabs](reference/arkui-js/js-components-container-tabs.md)
- [TabContent](reference/arkui-ts/ts-container-tabcontent.md) - [tab-bar](reference/arkui-js/js-components-container-tab-bar.md)
- [tab-content](reference/arkui-js/js-components-container-tab-content.md)
- [Refresh](reference/arkui-ts/ts-container-refresh.md) - [Basic Components](reference/arkui-js/js-components-basic.md)
- [Drawing Components](reference/arkui-ts/ts-drawing-components.md) - [button](reference/arkui-js/js-components-basic-button.md)
- [chart](reference/arkui-js/js-components-basic-chart.md)
- [Circle](reference/arkui-ts/ts-drawing-components-circle.md) - [divider](reference/arkui-js/js-components-basic-divider.md)
- [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md) - [image](reference/arkui-js/js-components-basic-image.md)
- [Line](reference/arkui-ts/ts-drawing-components-line.md) - [image-animator](reference/arkui-js/js-components-basic-image-animator.md)
- [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md) - [input](reference/arkui-js/js-components-basic-input.md)
- [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md) - [label](reference/arkui-js/js-components-basic-label.md)
- [Path](reference/arkui-ts/ts-drawing-components-path.md) - [marquee](reference/arkui-js/js-components-basic-marquee.md)
- [Rect](reference/arkui-ts/ts-drawing-components-rect.md) - [menu](reference/arkui-js/js-components-basic-menu.md)
- [Shape](reference/arkui-ts/ts-drawing-components-shape.md) - [option](reference/arkui-js/js-components-basic-option.md)
- [picker](reference/arkui-js/js-components-basic-picker.md)
- [Canvas Components](reference/arkui-ts/ts-components-canvas.md) - [picker-view](reference/arkui-js/js-components-basic-picker-view.md)
- [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md) - [piece](reference/arkui-js/js-components-basic-piece.md)
- [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md) - [progress](reference/arkui-js/js-components-basic-progress.md)
- [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - [qrcode](reference/arkui-js/js-components-basic-qrcode.md)
- [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) - [rating](reference/arkui-js/js-components-basic-rating.md)
- [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md) - [richtext](reference/arkui-js/js-components-basic-richtext.md)
- [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md) - [search](reference/arkui-js/js-components-basic-search.md)
- [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md) - [select](reference/arkui-js/js-components-basic-select.md)
- [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md) - [slider](reference/arkui-js/js-components-basic-slider.md)
- [Animation](reference/arkui-ts/ts-animation.md) - [span](reference/arkui-js/js-components-basic-span.md)
- [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md) - [switch](reference/arkui-js/js-components-basic-switch.md)
- [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md) - [text](reference/arkui-js/js-components-basic-text.md)
- [Transition Animation](reference/arkui-ts/ts-transition-animation.md) - [textarea](reference/arkui-js/js-components-basic-textarea.md)
- [Page Transition](reference/arkui-ts/ts-page-transition-animation.md) - [toolbar](reference/arkui-js/js-components-basic-toolbar.md)
- [Component Transition](reference/arkui-ts/ts-transition-animation-component.md) - [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md)
- [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md) - [toggle](reference/arkui-js/js-components-basic-toggle.md)
- [Media Components](reference/arkui-js/js-components-media.md)
- [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md) - [video](reference/arkui-js/js-components-media-video.md)
- [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md) - [Canvas Components](reference/arkui-js/js-components-canvas.md)
- [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md) - [canvas](reference/arkui-js/js-components-canvas-canvas.md)
- [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md)
- [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md) - [Image](reference/arkui-js/js-components-canvas-image.md)
- [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md) - [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md)
- [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md) - [ImageData](reference/arkui-js/js-components-canvas-imagedata.md)
- [Image Cache](reference/arkui-ts/ts-methods-image-cache.md) - [Path2D](reference/arkui-js/js-components-canvas-path2d.md)
- [Media Query](reference/arkui-ts/ts-methods-media-query.md) - [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md)
- [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md) - [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md)
- [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md)
- [Appendix](reference/arkui-ts/ts-appendix.md) - [Grid](reference/arkui-js/js-components-grid.md)
- [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md)
- [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md) - [grid-container](reference/arkui-js/js-components-grid-container.md)
- [APIs](reference/apis/Readme-EN.md) - [grid-row](reference/arkui-js/js-components-grid-row.md)
- Ability Framework - [grid-col](reference/arkui-js/js-components-grid-col.md)
- [FeatureAbility Module](reference/apis/js-apis-featureAbility.md) - [SVG Components](reference/arkui-js/js-svg.md)
- [ParticleAbility Module](reference/apis/js-apis-particleAbility.md) - [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md)
- [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md) - [svg](reference/arkui-js/js-components-svg.md)
- [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md) - [rect](reference/arkui-js/js-components-svg-rect.md)
- [Bundle Module](reference/apis/js-apis-Bundle.md) - [circle](reference/arkui-js/js-components-svg-circle.md)
- [Context Module](reference/apis/js-apis-Context.md) - [ellipse](reference/arkui-js/js-components-svg-ellipse.md)
- Event Notification - [path](reference/arkui-js/js-components-svg-path.md)
- [CommonEvent Module](reference/apis/js-apis-commonEvent.md) - [line](reference/arkui-js/js-components-svg-line.md)
- [Notification Module](reference/apis/js-apis-notification.md) - [polyline](reference/arkui-js/js-components-svg-polyline.md)
- [Reminder Agent](reference/apis/js-apis-reminderAgent.md) - [polygon](reference/arkui-js/js-components-svg-polygon.md)
- Resource Management - [text](reference/arkui-js/js-components-svg-text.md)
- [Resource Manager](reference/apis/js-apis-resource-manager.md) - [tspan](reference/arkui-js/js-components-svg-tspan.md)
- [Internationalization \(intl\) ](reference/apis/js-apis-intl.md) - [textPath](reference/arkui-js/js-components-svg-textpath.md)
- [Internationalization \(i18n\) ](reference/apis/js-apis-i18n.md) - [animate](reference/arkui-js/js-components-svg-animate.md)
- Media - [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md)
- [Audio Management](reference/apis/js-apis-audio.md) - [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md)
- [Media](reference/apis/js-apis-media.md) - [Custom Components](reference/arkui-js/js-components-custom.md)
- Security - [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md)
- [User Authentication](reference/apis/js-apis-useriam-userauth.md) - [Custom Events](reference/arkui-js/js-components-custom-events.md)
- [Access Control](reference/apis/js-apis-abilityAccessCtrl.md) - [props](reference/arkui-js/js-components-custom-props.md)
- Data Management - [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md)
- [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md) - [slot](reference/arkui-js/js-components-custom-slot.md)
- [Distributed Data Management](reference/apis/js-apis-distributed-data.md) - [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md)
- [Relational Database](reference/apis/js-apis-data-rdb.md) - [Appendix](reference/arkui-js/js-appendix.md)
- [Result Set](reference/apis/js-apis-data-resultset.md) - [Type Attributes](reference/arkui-js/js-appendix-types.md)
- [DataAbilityPredicates](reference/apis/js-apis-data-ability.md) - Compent Reference (TypeScript-based Declarative Development Paradigm)
- [Settings](reference/apis/js-apis-settings.md) - [Components](reference/arkui-ts/ts-components.md)
- File Management - [Universal Components](reference/arkui-ts/ts-universal-components.md)
- [File Management](reference/apis/js-apis-fileio.md) - [Universal Events](reference/arkui-ts/ts-universal-events.md)
- [Statfs](reference/apis/js-apis-statfs.md) - [Click Event](reference/arkui-ts/ts-universal-events-click.md)
- [Environment](reference/apis/js-apis-environment.md) - [Touch](reference/arkui-ts/ts-universal-events-touch.md)
- [Public File Access and Management](reference/apis/js-apis-filemanager.md) - [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md)
- [App Storage Statistics](reference/apis/js-apis-storage-statistics.md) - [Key Event](reference/arkui-ts/ts-universal-events-key.md)
- [Volume Management](reference/apis/js-apis-volumemanager.md) - [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md)
- Account Management - [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md)
- [Distributed Account Management](reference/apis/js-apis-distributed-account.md) - [Size](reference/arkui-ts/ts-universal-attributes-size.md)
- [App Account Management](reference/apis/js-apis-appAccount.md) - [Location](reference/arkui-ts/ts-universal-attributes-location.md)
- Telephony Service - [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md)
- [Call](reference/apis/js-apis-call.md) - [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md)
- [SMS](reference/apis/js-apis-sms.md) - [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md)
- [SIM Management](reference/apis/js-apis-sim.md) - [Background](reference/arkui-ts/ts-universal-attributes-background.md)
- [Radio](reference/apis/js-apis-radio.md) - [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md)
- [observer](reference/apis/js-apis-observer.md) - [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md)
- [Cellular Data](reference/apis/js-apis-telephony-data.md) - [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md)
- Network and Connectivity - [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md)
- [WLAN](reference/apis/js-apis-wifi.md) - [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md)
- [Bluetooth](reference/apis/js-apis-bluetooth.md) - [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md)
- [RPC](reference/apis/js-apis-rpc.md) - [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md)
- Device Management - [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md)
- [Sensor](reference/apis/js-apis-sensor.md) - [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md)
- [Vibrator](reference/apis/js-apis-vibrator.md) - [Grid](reference/arkui-ts/ts-universal-attributes-grid.md)
- [Brightness](reference/apis/js-apis-brightness.md) - [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md)
- [Battery Info](reference/apis/js-apis-battery-info.md) - [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md)
- [Power Management](reference/apis/js-apis-power.md) - [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md)
- [Thermal Management](reference/apis/js-apis-thermal.md) - [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md)
- [Running Lock](reference/apis/js-apis-runninglock.md) - [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md)
- [Device Info](reference/apis/js-apis-device-info.md) - [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md)
- [systemParameter](reference/apis/js-apis-system-parameter.md) - [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md)
- [Device Management](reference/apis/js-apis-device-manager.md) - [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md)
- [Window](reference/apis/js-apis-window.md) - [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md)
- [Display](reference/apis/js-apis-display.md) - [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md)
- [Update](reference/apis/js-apis-update.md) - [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md)
- [USB](reference/apis/js-apis-usb.md) - [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md)
- [Location](reference/apis/js-apis-geolocation.md) - [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md)
- Basic Features - [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md)
- [Application Context](reference/apis/js-apis-basic-features-app-context.md) - [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md)
- [Console Logs](reference/apis/js-apis-basic-features-logs.md) - [Basic Components](reference/arkui-ts/ts-basic-components.md)
- [Page Routing](reference/apis/js-apis-basic-features-routes.md) - [Blank](reference/arkui-ts/ts-basic-components-blank.md)
- [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md) - [Button](reference/arkui-ts/ts-basic-components-button.md)
- [Application Configuration](reference/apis/js-apis-basic-features-configuration.md) - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md)
- [Timer](reference/apis/js-apis-basic-features-timer.md) - [Divider](reference/arkui-ts/ts-basic-components-divider.md)
- [Setting the System Time](reference/apis/js-apis-system-time.md) - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md)
- [Animation](reference/apis/js-apis-basic-features-animator.md) - [Image](reference/arkui-ts/ts-basic-components-image.md)
- [WebGL](reference/apis/js-apis-webgl.md) - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md)
- [WebGL2](reference/apis/js-apis-webgl2.md) - [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md)
- [Screenshot](reference/apis/js-apis-screenshot.md) - [Marquee](reference/arkui-ts/ts-basic-components-marquee.md)
- DFX - [Progress](reference/arkui-ts/ts-basic-components-progress.md)
- [HiAppEvent](reference/apis/js-apis-hiappevent.md) - [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md)
- [Performance Tracing](reference/apis/js-apis-hitracemeter.md) - [Rating](reference/arkui-ts/ts-basic-components-rating.md)
- [Fault Logger](reference/apis/js-apis-faultLogger.md) - [Select](reference/arkui-ts/ts-basic-components-select.md)
- [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md) - [Slider](reference/arkui-ts/ts-basic-components-slider.md)
- [HiLog](reference/apis/js-apis-hilog.md) - [Span](reference/arkui-ts/ts-basic-components-span.md)
- [HiChecker](reference/apis/js-apis-hichecker.md) - [Text](reference/arkui-ts/ts-basic-components-text.md)
- [HiDebug](reference/apis/js-apis-hidebug.md) - [TextArea](reference/arkui-ts/ts-basic-components-textarea.md)
- Language Base Class Library - [TextInput](reference/arkui-ts/ts-basic-components-textinput.md)
- [Obtaining Process Information](reference/apis/js-apis-process.md) - [Toggle](reference/arkui-ts/ts-basic-components-toggle.md)
- [URL String Parsing](reference/apis/js-apis-url.md) - [TextClock](reference/arkui-ts/ts-basic-components-textclock.md)
- [URI String Parsing](reference/apis/js-apis-uri.md) - [Container Components](reference/arkui-ts/ts-components-container.md)
- [Util](reference/apis/js-apis-util.md) - [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md)
- [XML Parsing and Generation](reference/apis/js-apis-xml.md) - [Badge](reference/arkui-ts/ts-container-badge.md)
- [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md) - [Column](reference/arkui-ts/ts-container-column.md)
- [Worker Startup](reference/apis/js-apis-worker.md) - [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md)
- [Linear Container ArrayList](reference/apis/js-apis-arraylist.md) - [Counter](reference/arkui-ts/ts-container-counter.md)
- [Linear Container Deque](reference/apis/js-apis-deque.md) - [Flex](reference/arkui-ts/ts-container-flex.md)
- [Linear Container List](reference/apis/js-apis-list.md) - [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md)
- [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md) - [Grid](reference/arkui-ts/ts-container-grid.md)
- [Linear Container Queue](reference/apis/js-apis-queue.md) - [GridItem](reference/arkui-ts/ts-container-griditem.md)
- [Linear Container Stack](reference/apis/js-apis-stack.md) - [List](reference/arkui-ts/ts-container-list.md)
- [Linear Container Vector](reference/apis/js-apis-vector.md) - [ListItem](reference/arkui-ts/ts-container-listitem.md)
- [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md) - [Navigator](reference/arkui-ts/ts-container-navigator.md)
- [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md) - [Navigation](reference/arkui-ts/ts-container-navigation.md)
- [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md) - [Panel](reference/arkui-ts/ts-container-panel.md)
- [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md) - [Row](reference/arkui-ts/ts-container-row.md)
- [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md) - [RowSplit](reference/arkui-ts/ts-container-rowsplit.md)
- [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md) - [Scroll](reference/arkui-ts/ts-container-scroll.md)
- [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md) - [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md)
\ No newline at end of file - [Stack](reference/arkui-ts/ts-container-stack.md)
- [Swiper](reference/arkui-ts/ts-container-swiper.md)
- [Tabs](reference/arkui-ts/ts-container-tabs.md)
- [TabContent](reference/arkui-ts/ts-container-tabcontent.md)
- [Refresh](reference/arkui-ts/ts-container-refresh.md)
- [Drawing Components](reference/arkui-ts/ts-drawing-components.md)
- [Circle](reference/arkui-ts/ts-drawing-components-circle.md)
- [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md)
- [Line](reference/arkui-ts/ts-drawing-components-line.md)
- [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md)
- [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md)
- [Path](reference/arkui-ts/ts-drawing-components-path.md)
- [Rect](reference/arkui-ts/ts-drawing-components-rect.md)
- [Shape](reference/arkui-ts/ts-drawing-components-shape.md)
- [Canvas Components](reference/arkui-ts/ts-components-canvas.md)
- [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md)
- [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md)
- [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md)
- [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md)
- [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md)
- [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md)
- [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md)
- [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md)
- [Animation](reference/arkui-ts/ts-animation.md)
- [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md)
- [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md)
- [Transition Animation](reference/arkui-ts/ts-transition-animation.md)
- [Page Transition](reference/arkui-ts/ts-page-transition-animation.md)
- [Component Transition](reference/arkui-ts/ts-transition-animation-component.md)
- [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md)
- [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md)
- [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md)
- [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md)
- [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md)
- [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md)
- [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md)
- [Image Cache](reference/arkui-ts/ts-methods-image-cache.md)
- [Media Query](reference/arkui-ts/ts-methods-media-query.md)
- [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md)
- [Appendix](reference/arkui-ts/ts-appendix.md)
- [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md)
- APIs
- Ability Framework
- [FeatureAbility Module](reference/apis/js-apis-featureAbility.md)
- [ParticleAbility Module](reference/apis/js-apis-particleAbility.md)
- [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md)
- [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md)
- [Bundle Module](reference/apis/js-apis-Bundle.md)
- [Context Module](reference/apis/js-apis-Context.md)
- Event Notification
- [CommonEvent Module](reference/apis/js-apis-commonEvent.md)
- [Notification Module](reference/apis/js-apis-notification.md)
- [Reminder Agent](reference/apis/js-apis-reminderAgent.md)
- Resource Management
- [Resource Manager](reference/apis/js-apis-resource-manager.md)
- [Internationalization (intl)](reference/apis/js-apis-intl.md)
- [Internationalization (i18n)](reference/apis/js-apis-i18n.md)
- Media
- [Audio Management](reference/apis/js-apis-audio.md)
- [Media](reference/apis/js-apis-media.md)
- Security
- [User Authentication](reference/apis/js-apis-useriam-userauth.md)
- [Access Control](reference/apis/js-apis-abilityAccessCtrl.md)
- Data Management
- [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md)
- [Distributed Data Management](reference/apis/js-apis-distributed-data.md)
- [Relational Database](reference/apis/js-apis-data-rdb.md)
- [Result Set](reference/apis/js-apis-data-resultset.md)
- [DataAbilityPredicates](reference/apis/js-apis-data-ability.md)
- [Settings](reference/apis/js-apis-settings.md)
- File Management
- [File Management](reference/apis/js-apis-fileio.md)
- [Statfs](reference/apis/js-apis-statfs.md)
- [Environment](reference/apis/js-apis-environment.md)
- [Public File Access and Management](reference/apis/js-apis-filemanager.md)
- [App Storage Statistics](reference/apis/js-apis-storage-statistics.md)
- [Volume Management](reference/apis/js-apis-volumemanager.md)
- Account Management
- [Distributed Account Management](reference/apis/js-apis-distributed-account.md)
- [App Account Management](reference/apis/js-apis-appAccount.md)
- Telephony Service
- [Call](reference/apis/js-apis-call.md)
- [SMS](reference/apis/js-apis-sms.md)
- [SIM Management](reference/apis/js-apis-sim.md)
- [Radio](reference/apis/js-apis-radio.md)
- [observer](reference/apis/js-apis-observer.md)
- [Cellular Data](reference/apis/js-apis-telephony-data.md)
- Network and Connectivity
- [WLAN](reference/apis/js-apis-wifi.md)
- [Bluetooth](reference/apis/js-apis-bluetooth.md)
- [RPC](reference/apis/js-apis-rpc.md)
- Device Management
- [Sensor](reference/apis/js-apis-sensor.md)
- [Vibrator](reference/apis/js-apis-vibrator.md)
- [Brightness](reference/apis/js-apis-brightness.md)
- [Battery Info](reference/apis/js-apis-battery-info.md)
- [Power Management](reference/apis/js-apis-power.md)
- [Thermal Management](reference/apis/js-apis-thermal.md)
- [Running Lock](reference/apis/js-apis-runninglock.md)
- [Device Info](reference/apis/js-apis-device-info.md)
- [systemParameter](reference/apis/js-apis-system-parameter.md)
- [Device Management](reference/apis/js-apis-device-manager.md)
- [Window](reference/apis/js-apis-window.md)
- [Display](reference/apis/js-apis-display.md)
- [Update](reference/apis/js-apis-update.md)
- [USB](reference/apis/js-apis-usb.md)
- [Location](reference/apis/js-apis-geolocation.md)
- Basic Features
- [Application Context](reference/apis/js-apis-basic-features-app-context.md)
- [Console Logs](reference/apis/js-apis-basic-features-logs.md)
- [Page Routing](reference/apis/js-apis-basic-features-routes.md)
- [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md)
- [Application Configuration](reference/apis/js-apis-basic-features-configuration.md)
- [Timer](reference/apis/js-apis-basic-features-timer.md)
- [Setting the System Time](reference/apis/js-apis-system-time.md)
- [Animation](reference/apis/js-apis-basic-features-animator.md)
- [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md)
- [Screenshot](reference/apis/js-apis-screenshot.md)
- DFX
- [HiAppEvent](reference/apis/js-apis-hiappevent.md)
- [Performance Tracing](reference/apis/js-apis-hitracemeter.md)
- [Fault Logger](reference/apis/js-apis-faultLogger.md)
- [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md)
- [HiLog](reference/apis/js-apis-hilog.md)
- [HiChecker](reference/apis/js-apis-hichecker.md)
- [HiDebug](reference/apis/js-apis-hidebug.md)
- Language Base Class Library
- [Obtaining Process Information](reference/apis/js-apis-process.md)
- [URL String Parsing](reference/apis/js-apis-url.md)
- [URI String Parsing](reference/apis/js-apis-uri.md)
- [Util](reference/apis/js-apis-util.md)
- [XML Parsing and Generation](reference/apis/js-apis-xml.md)
- [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md)
- [Worker Startup](reference/apis/js-apis-worker.md)
- [Linear Container ArrayList](reference/apis/js-apis-arraylist.md)
- [Linear Container Deque](reference/apis/js-apis-deque.md)
- [Linear Container List](reference/apis/js-apis-list.md)
- [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md)
- [Linear Container Queue](reference/apis/js-apis-queue.md)
- [Linear Container Stack](reference/apis/js-apis-stack.md)
- [Linear Container Vector](reference/apis/js-apis-vector.md)
- [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md)
- [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md)
- [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md)
- [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md)
- [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md)
- [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md)
- [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md)
\ No newline at end of file
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
- [Startup](subsystems/subsys-boot.md) - [Startup](subsystems/subsys-boot.md)
- [DFX](subsystems/subsys-dfx.md) - [DFX](subsystems/subsys-dfx.md)
- Featured Topics - Featured Topics
- [HPM Bundle](bundles/Readme-EN.md) - HPM Bundle
- [Development Specifications](bundles/bundles-standard-rules.md) - [Development Specifications](bundles/bundles-standard-rules.md)
- Development Guidelines - Development Guidelines
- [Bundle Development](bundles/bundles-guide-overview.md) - [Bundle Development](bundles/bundles-guide-overview.md)
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- [Codelabs](https://gitee.com/openharmony/codelabs/blob/master/README.md) - [Codelabs](https://gitee.com/openharmony/codelabs/blob/master/README.md)
- References - References
- [FAQs](faqs/Readme-EN.md) - FAQs
- [Overview of FAQs](faqs/faqs-overview.md) - [Overview of FAQs](faqs/faqs-overview.md)
- [Environment Setup](faqs/faqs-environment-setup.md) - [Environment Setup](faqs/faqs-environment-setup.md)
- [Compilation and Building Subsystem](faqs/faqs-building.md) - [Compilation and Building Subsystem](faqs/faqs-building.md)
......
- [Application Development Overview](application-dev-guide.md) # Learn About OpenHarmony
- Quick Start
- [Getting Started with Application Development](quick-start/Readme-EN.md) - [OpenHarmony Project](OpenHarmony-Overview.md)
- DevEco Studio (OpenHarmony) User Guide - [Glossary](device-dev/glossary/glossary.md)
- [Overview](quick-start/deveco-studio-overview.md) - OpenHarmony Release Notes
- [Version Change History](quick-start/deveco-studio-release-notes.md) - OpenHarmony 3.x Releases
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) - [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md)
- [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md) - [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
- [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - OpenHarmony 2.x Releases
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) - [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md)
- [Directory Structure](quick-start/package-structure.md) - [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
- Development
- UI - OpenHarmony 1.x Releases
- JavaScript-based Web-Like Development Paradigm - [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md)
- [Overview](ui/ui-js-overview.md) - [OpenHarmony v1.1.3 LTS (2021-09-30)](release-notes/OpenHarmony-v1-1-3-LTS.md)
- Framework - [OpenHarmony v1.1.2 LTS (2021-08-04)](release-notes/OpenHarmony-v1.1.2-LTS.md)
- [File Organization](ui/js-framework-file.md) - [OpenHarmony 1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md)
- ["js" Tag](ui/js-framework-js-tag.md) - [OpenHarmony 1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md)
- [app.js](ui/js-framework-js-file.md) - [OpenHarmony 1.0 (2020-09-10)](release-notes/OpenHarmony-1-0.md)
- Syntax - Contribution
- [HML](ui/js-framework-syntax-hml.md) - [Contribution](contribute/contribution.md)
- [CSS](ui/js-framework-syntax-css.md) - [Code of Conduct](contribute/code-of-conduct.md)
- [JavaScript](ui/js-framework-syntax-js.md) - [Code Contribution](contribute/code-contribution.md)
- [Lifecycle](ui/js-framework-lifecycle.md) - [Contribution Process](contribute/contribution-process.md)
- [Resource Limitations and Access](ui/js-framework-resource-restriction.md) - [Auto-Test](readme/test_subsystem.md)
- [Multi-Language Capability](ui/js-framework-multiple-languages.md) - [Documentation Contribution](contribute/documentation-contribution.md)
- Building the UI - [Writing Instructions](contribute/writing-instructions.md)
- [Component Overview](ui/ui-js-building-ui-component.md) - [Communication in Community](contribute/communication-in-community.md)
- Building the Layout - [FAQs](contribute/FAQ.md)
- [Layout Description](ui/ui-js-building-ui-layout-intro.md) \ No newline at end of file
- [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md)
- [Adding an Image](ui/ui-js-building-ui-layout-image.md)
- [Adding a Comment](ui/ui-js-building-ui-layout-comment.md)
- [Adding a Container](ui/ui-js-building-ui-layout-external-container.md)
- [Adding Interactions](ui/ui-js-building-ui-interactions.md)
- [Developing Animations](ui/ui-js-building-ui-animation.md)
- [Defining Events](ui/ui-js-building-ui-event.md)
- [Defining Page Routes](ui/ui-js-building-ui-routes.md)
- Common Component Development Guidelines
- [Text](ui/ui-js-components-text.md)
- [Input](ui/ui-js-components-input.md)
- [Button](ui/ui-js-components-button.md)
- [List](ui/ui-js-components-list.md)
- [Picker](ui/ui-js-components-picker.md)
- [Dialog](ui/ui-js-components-dialog.md)
- [Form](ui/ui-js-components-form.md)
- [Stepper](ui/ui-js-components-stepper.md)
- [Tabs](ui/ui-js-component-tabs.md)
- [Image](ui/ui-js-components-images.md)
- Animation Development Guidelines
- CSS Animation
- [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md)
- [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md)
- [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md)
- JS Animation
- [Component Animation](ui/ui-js-animate-component.md)
- Interpolator Animation
- [Animation Effect](ui/ui-js-animate-dynamic-effects.md)
- [Animation Frame](ui/ui-js-animate-frame.md)
- [Custom Components](ui/ui-js-custom-components.md)
- TypeScript-based Declarative Development Paradigm
- [Overview](ui/ui-ts-overview.md)
- Framework Overview
- File Organization
- [Directory Structure](ui/ts-framework-directory.md)
- [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md)
- ["js" Tag](ui/ts-framework-js-tag.md)
- Resource Access
- [Media Resource Types](ui/ts-media-resource-type.md)
- [Pixel Units](ui/ts-pixel-units.md)
- [Types](ui/ts-types.md)
- Declarative Syntax
- [Overview](ui/ts-syntax-intro.md)
- General UI Description Specifications
- [Basic Concepts](ui/ts-general-ui-concepts.md)
- Declarative UI Description Specifications
- [Parameterless Configuration](ui/ts-parameterless-configuration.md)
- [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md)
- [Attribution Configuration](ui/ts-attribution-configuration.md)
- [Event Configuration](ui/ts-event-configuration.md)
- [Child Component Configuration](ui/ts-child-component-configuration.md)
- Componentization
- [@Component](ui/ts-component-based-component.md)
- [@Entry](ui/ts-component-based-entry.md)
- [@Preview](ui/ts-component-based-preview.md)
- [@Builder](ui/ts-component-based-builder.md)
- [@Extend](ui/ts-component-based-extend.md)
- [@CustomDialog](ui/ts-component-based-customdialog.md)
- About UI State Management
- [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md)
- Managing Component States
- [@State](ui/ts-component-states-state.md)
- [@Prop](ui/ts-component-states-prop.md)
- [@Link](ui/ts-component-states-link.md)
- Managing Application States
- [AppStorage](ui/ts-application-states-appstorage.md)
- [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md)
- [Environment](ui/ts-application-states-apis-environment.md)
- Managing Other States
- [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md)
- [@Consume and @Provide](ui/ts-other-states-consume-provide.md)
- [@Watch](ui/ts-other-states-watch.md)
- About Rendering Control Syntax
- [if/else](ui/ts-rending-control-syntax-if-else.md)
- [ForEach](ui/ts-rending-control-syntax-foreach.md)
- [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md)
- About @Component
- [build Function](ui/ts-function-build.md)
- [Custom Component Initialization](ui/ts-custom-component-initialization.md)
- [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md)
- [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md)
- [Syntactic Sugar](ui/ts-syntactic-sugar.md)
- Experiencing the Declarative UI
- [Creating a Declarative UI Project](ui/ui-ts-creating-project.md)
- [Getting to Know Components](ui/ui-ts-components.md)
- [Creating a Simple Page](ui/ui-ts-creating-simple-page.md)
- Defining Page Layout and Connection
- [Building a Food Data Model](ui/ui-ts-building-data-model.md)
- [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md)
- [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md)
- [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md)
- Basic Functions
- Agent-Powered Scheduled Reminders
- [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md)
- [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md)
- Background Task Management
- [Background Task Management Overview](background-task-management/background-task-overview.md)
- [Background Task Management Development](background-task-management/background-task-dev-guide.md)
- WebGL
- [WebGL Overview](webgl/webgl-overview.md)
- [WebGL Development](webgl/webgl-guidelines.md)
- Media
- Audio
- [Audio Overview](media/audio-overview.md)
- [Audio Playback Development](media/audio-playback.md)
- [Audio Playback Development Using AudioRenderer](media/audio-renderer.md)
- [Audio Recording Development](media/audio-recorder.md)
- [Audio Recorder Development Using AudioCapturer](media/audio-capturer)
- Video
- [Video Playback Development](media/video-playback.md)
- [Video Recording Development](media/video-recorder.md)
- Security
- User Authentication
- [User Authentication Overview](security/userauth-overview.md)
- [User Authentication Development](security/userauth-guidelines.md)
- Connectivity
- IPC & RPC
- [IPC & RPC Overview](connectivity/ipc-rpc-overview.md)
- [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md)
- [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md)
- Data Management
- Distributed Data Service
- [Distributed Data Service Overview](database/database-mdds-overview.md)
- [Distributed Data Service Development](database/database-mdds-guidelines.md)
- Relational Database Overview
- [RDB Overview](database/database-relational-overview.md)
- [RDB Development](database/database-relational-guidelines.md)
- Lightweight Data Store
- [Lightweight Data Store Overview](database/database-preference-overview.md)
- [Lightweight Data Store Development](database/database-preference-guidelines.md)
- Device
- USB Service
- [USB Service Overview](device/usb-overview.md)
- [USB Service Development](device/usb-guidelines.md)
- Location
- [Location Overview](device/device-location-overview.md)
- [Obtaining Device Location Information](device/device-location-info.md)
- [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md)
- DFX
- Application Event Logging
- [Overview of Application Event Logging](dfx/hiappevent-overview.md)
- [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md)
- Tools
- DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- Hands-On Tutorials
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- API References
- Compent Reference (JavaScript-based Web-like Development Paradigm)
- [Components](reference/arkui-js/js-components.md)
- [Common](reference/arkui-js/js-components-common.md)
- [Universal Attributes](reference/arkui-js/js-components-common-attributes.md)
- [Universal Styles](reference/arkui-js/js-components-common-styles.md)
- [Universal Events](reference/arkui-js/js-components-common-events.md)
- [Universal Methods](reference/arkui-js/js-components-common-methods.md)
- [Animation Styles](reference/arkui-js/js-components-common-animation.md)
- [Gradient Styles](reference/arkui-js/js-components-common-gradient.md)
- [Transition Styles](reference/arkui-js/js-components-common-transition.md)
- [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md)
- [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md)
- [Container Component](reference/arkui-js/js-components-container.md)
- [badge](reference/arkui-js/js-components-container-badge.md)
- [dialog](reference/arkui-js/js-components-container-dialog.md)
- [div](reference/arkui-js/js-components-container-div.md)
- [form](reference/arkui-js/js-components-container-form.md)
- [list](reference/arkui-js/js-components-container-list.md)
- [list-item](reference/arkui-js/js-components-container-list-item.md)
- [list-item-group](reference/arkui-js/js-components-container-list-item-group.md)
- [panel](reference/arkui-js/js-components-container-panel.md)
- [popup](reference/arkui-js/js-components-container-popup.md)
- [refresh](reference/arkui-js/js-components-container-refresh.md)
- [stack](reference/arkui-js/js-components-container-stack.md)
- [stepper](reference/arkui-js/js-components-container-stepper.md)
- [stepper-item](reference/arkui-js/js-components-container-stepper-item.md)
- [swiper](reference/arkui-js/js-components-container-swiper.md)
- [tabs](reference/arkui-js/js-components-container-tabs.md)
- [tab-bar](reference/arkui-js/js-components-container-tab-bar.md)
- [tab-content](reference/arkui-js/js-components-container-tab-content.md)
- [Basic Components](reference/arkui-js/js-components-basic.md)
- [button](reference/arkui-js/js-components-basic-button.md)
- [chart](reference/arkui-js/js-components-basic-chart.md)
- [divider](reference/arkui-js/js-components-basic-divider.md)
- [image](reference/arkui-js/js-components-basic-image.md)
- [image-animator](reference/arkui-js/js-components-basic-image-animator.md)
- [input](reference/arkui-js/js-components-basic-input.md)
- [label](reference/arkui-js/js-components-basic-label.md)
- [marquee](reference/arkui-js/js-components-basic-marquee.md)
- [menu](reference/arkui-js/js-components-basic-menu.md)
- [option](reference/arkui-js/js-components-basic-option.md)
- [picker](reference/arkui-js/js-components-basic-picker.md)
- [picker-view](reference/arkui-js/js-components-basic-picker-view.md)
- [piece](reference/arkui-js/js-components-basic-piece.md)
- [progress](reference/arkui-js/js-components-basic-progress.md)
- [qrcode](reference/arkui-js/js-components-basic-qrcode.md)
- [rating](reference/arkui-js/js-components-basic-rating.md)
- [richtext](reference/arkui-js/js-components-basic-richtext.md)
- [search](reference/arkui-js/js-components-basic-search.md)
- [select](reference/arkui-js/js-components-basic-select.md)
- [slider](reference/arkui-js/js-components-basic-slider.md)
- [span](reference/arkui-js/js-components-basic-span.md)
- [switch](reference/arkui-js/js-components-basic-switch.md)
- [text](reference/arkui-js/js-components-basic-text.md)
- [textarea](reference/arkui-js/js-components-basic-textarea.md)
- [toolbar](reference/arkui-js/js-components-basic-toolbar.md)
- [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md)
- [toggle](reference/arkui-js/js-components-basic-toggle.md)
- [Media Components](reference/arkui-js/js-components-media.md)
- [video](reference/arkui-js/js-components-media-video.md)
- [Canvas Components](reference/arkui-js/js-components-canvas.md)
- [canvas](reference/arkui-js/js-components-canvas-canvas.md)
- [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md)
- [Image](reference/arkui-js/js-components-canvas-image.md)
- [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md)
- [ImageData](reference/arkui-js/js-components-canvas-imagedata.md)
- [Path2D](reference/arkui-js/js-components-canvas-path2d.md)
- [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md)
- [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md)
- [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md)
- [Grid](reference/arkui-js/js-components-grid.md)
- [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md)
- [grid-container](reference/arkui-js/js-components-grid-container.md)
- [grid-row](reference/arkui-js/js-components-grid-row.md)
- [grid-col](reference/arkui-js/js-components-grid-col.md)
- [SVG Components](reference/arkui-js/js-svg.md)
- [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md)
- [svg](reference/arkui-js/js-components-svg.md)
- [rect](reference/arkui-js/js-components-svg-rect.md)
- [circle](reference/arkui-js/js-components-svg-circle.md)
- [ellipse](reference/arkui-js/js-components-svg-ellipse.md)
- [path](reference/arkui-js/js-components-svg-path.md)
- [line](reference/arkui-js/js-components-svg-line.md)
- [polyline](reference/arkui-js/js-components-svg-polyline.md)
- [polygon](reference/arkui-js/js-components-svg-polygon.md)
- [text](reference/arkui-js/js-components-svg-text.md)
- [tspan](reference/arkui-js/js-components-svg-tspan.md)
- [textPath](reference/arkui-js/js-components-svg-textpath.md)
- [animate](reference/arkui-js/js-components-svg-animate.md)
- [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md)
- [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md)
- [Custom Components](reference/arkui-js/js-components-custom.md)
- [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md)
- [Custom Events](reference/arkui-js/js-components-custom-events.md)
- [props](reference/arkui-js/js-components-custom-props.md)
- [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md)
- [slot](reference/arkui-js/js-components-custom-slot.md)
- [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md)
- [Appendix](reference/arkui-js/js-appendix.md)
- [Type Attributes](reference/arkui-js/js-appendix-types.md)
- Compent Reference (TypeScript-based Declarative Development Paradigm)
- [Components](reference/arkui-ts/ts-components.md)
- [Universal Components](reference/arkui-ts/ts-universal-components.md)
- [Universal Events](reference/arkui-ts/ts-universal-events.md)
- [Click Event](reference/arkui-ts/ts-universal-events-click.md)
- [Touch](reference/arkui-ts/ts-universal-events-touch.md)
- [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md)
- [Key Event](reference/arkui-ts/ts-universal-events-key.md)
- [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md)
- [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md)
- [Size](reference/arkui-ts/ts-universal-attributes-size.md)
- [Location](reference/arkui-ts/ts-universal-attributes-location.md)
- [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md)
- [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md)
- [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md)
- [Background](reference/arkui-ts/ts-universal-attributes-background.md)
- [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md)
- [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md)
- [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md)
- [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md)
- [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md)
- [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md)
- [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md)
- [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md)
- [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md)
- [Grid](reference/arkui-ts/ts-universal-attributes-grid.md)
- [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md)
- [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md)
- [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md)
- [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md)
- [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md)
- [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md)
- [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md)
- [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md)
- [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md)
- [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md)
- [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md)
- [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md)
- [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md)
- [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md)
- [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md)
- [Basic Components](reference/arkui-ts/ts-basic-components.md)
- [Blank](reference/arkui-ts/ts-basic-components-blank.md)
- [Button](reference/arkui-ts/ts-basic-components-button.md)
- [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md)
- [Divider](reference/arkui-ts/ts-basic-components-divider.md)
- [Gauge](reference/arkui-ts/ts-basic-components-gauge.md)
- [Image](reference/arkui-ts/ts-basic-components-image.md)
- [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md)
- [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md)
- [Marquee](reference/arkui-ts/ts-basic-components-marquee.md)
- [Progress](reference/arkui-ts/ts-basic-components-progress.md)
- [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md)
- [Rating](reference/arkui-ts/ts-basic-components-rating.md)
- [Select](reference/arkui-ts/ts-basic-components-select.md)
- [Slider](reference/arkui-ts/ts-basic-components-slider.md)
- [Span](reference/arkui-ts/ts-basic-components-span.md)
- [Text](reference/arkui-ts/ts-basic-components-text.md)
- [TextArea](reference/arkui-ts/ts-basic-components-textarea.md)
- [TextInput](reference/arkui-ts/ts-basic-components-textinput.md)
- [Toggle](reference/arkui-ts/ts-basic-components-toggle.md)
- [TextClock](reference/arkui-ts/ts-basic-components-textclock.md)
- [Container Components](reference/arkui-ts/ts-components-container.md)
- [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md)
- [Badge](reference/arkui-ts/ts-container-badge.md)
- [Column](reference/arkui-ts/ts-container-column.md)
- [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md)
- [Counter](reference/arkui-ts/ts-container-counter.md)
- [Flex](reference/arkui-ts/ts-container-flex.md)
- [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md)
- [Grid](reference/arkui-ts/ts-container-grid.md)
- [GridItem](reference/arkui-ts/ts-container-griditem.md)
- [List](reference/arkui-ts/ts-container-list.md)
- [ListItem](reference/arkui-ts/ts-container-listitem.md)
- [Navigator](reference/arkui-ts/ts-container-navigator.md)
- [Navigation](reference/arkui-ts/ts-container-navigation.md)
- [Panel](reference/arkui-ts/ts-container-panel.md)
- [Row](reference/arkui-ts/ts-container-row.md)
- [RowSplit](reference/arkui-ts/ts-container-rowsplit.md)
- [Scroll](reference/arkui-ts/ts-container-scroll.md)
- [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md)
- [Stack](reference/arkui-ts/ts-container-stack.md)
- [Swiper](reference/arkui-ts/ts-container-swiper.md)
- [Tabs](reference/arkui-ts/ts-container-tabs.md)
- [TabContent](reference/arkui-ts/ts-container-tabcontent.md)
- [Refresh](reference/arkui-ts/ts-container-refresh.md)
- [Drawing Components](reference/arkui-ts/ts-drawing-components.md)
- [Circle](reference/arkui-ts/ts-drawing-components-circle.md)
- [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md)
- [Line](reference/arkui-ts/ts-drawing-components-line.md)
- [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md)
- [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md)
- [Path](reference/arkui-ts/ts-drawing-components-path.md)
- [Rect](reference/arkui-ts/ts-drawing-components-rect.md)
- [Shape](reference/arkui-ts/ts-drawing-components-shape.md)
- [Canvas Components](reference/arkui-ts/ts-components-canvas.md)
- [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md)
- [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md)
- [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md)
- [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md)
- [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md)
- [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md)
- [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md)
- [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md)
- [Animation](reference/arkui-ts/ts-animation.md)
- [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md)
- [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md)
- [Transition Animation](reference/arkui-ts/ts-transition-animation.md)
- [Page Transition](reference/arkui-ts/ts-page-transition-animation.md)
- [Component Transition](reference/arkui-ts/ts-transition-animation-component.md)
- [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md)
- [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md)
- [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md)
- [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md)
- [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md)
- [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md)
- [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md)
- [Image Cache](reference/arkui-ts/ts-methods-image-cache.md)
- [Media Query](reference/arkui-ts/ts-methods-media-query.md)
- [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md)
- [Appendix](reference/arkui-ts/ts-appendix.md)
- [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md)
- APIs
- Ability Framework
- [FeatureAbility Module](reference/apis/js-apis-featureAbility.md)
- [ParticleAbility Module](reference/apis/js-apis-particleAbility.md)
- [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md)
- [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md)
- [Bundle Module](reference/apis/js-apis-Bundle.md)
- [Context Module](reference/apis/js-apis-Context.md)
- Event Notification
- [CommonEvent Module](reference/apis/js-apis-commonEvent.md)
- [Notification Module](reference/apis/js-apis-notification.md)
- [Reminder Agent](reference/apis/js-apis-reminderAgent.md)
- Resource Management
- [Resource Manager](reference/apis/js-apis-resource-manager.md)
- [Internationalization (intl)](reference/apis/js-apis-intl.md)
- [Internationalization (i18n)](reference/apis/js-apis-i18n.md)
- Media
- [Audio Management](reference/apis/js-apis-audio.md)
- [Media](reference/apis/js-apis-media.md)
- Security
- [User Authentication](reference/apis/js-apis-useriam-userauth.md)
- [Access Control](reference/apis/js-apis-abilityAccessCtrl.md)
- Data Management
- [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md)
- [Distributed Data Management](reference/apis/js-apis-distributed-data.md)
- [Relational Database](reference/apis/js-apis-data-rdb.md)
- [Result Set](reference/apis/js-apis-data-resultset.md)
- [DataAbilityPredicates](reference/apis/js-apis-data-ability.md)
- [Settings](reference/apis/js-apis-settings.md)
- File Management
- [File Management](reference/apis/js-apis-fileio.md)
- [Statfs](reference/apis/js-apis-statfs.md)
- [Environment](reference/apis/js-apis-environment.md)
- [Public File Access and Management](reference/apis/js-apis-filemanager.md)
- [App Storage Statistics](reference/apis/js-apis-storage-statistics.md)
- [Volume Management](reference/apis/js-apis-volumemanager.md)
- Account Management
- [Distributed Account Management](reference/apis/js-apis-distributed-account.md)
- [App Account Management](reference/apis/js-apis-appAccount.md)
- Telephony Service
- [Call](reference/apis/js-apis-call.md)
- [SMS](reference/apis/js-apis-sms.md)
- [SIM Management](reference/apis/js-apis-sim.md)
- [Radio](reference/apis/js-apis-radio.md)
- [observer](reference/apis/js-apis-observer.md)
- [Cellular Data](reference/apis/js-apis-telephony-data.md)
- Network and Connectivity
- [WLAN](reference/apis/js-apis-wifi.md)
- [Bluetooth](reference/apis/js-apis-bluetooth.md)
- [RPC](reference/apis/js-apis-rpc.md)
- Device Management
- [Sensor](reference/apis/js-apis-sensor.md)
- [Vibrator](reference/apis/js-apis-vibrator.md)
- [Brightness](reference/apis/js-apis-brightness.md)
- [Battery Info](reference/apis/js-apis-battery-info.md)
- [Power Management](reference/apis/js-apis-power.md)
- [Thermal Management](reference/apis/js-apis-thermal.md)
- [Running Lock](reference/apis/js-apis-runninglock.md)
- [Device Info](reference/apis/js-apis-device-info.md)
- [systemParameter](reference/apis/js-apis-system-parameter.md)
- [Device Management](reference/apis/js-apis-device-manager.md)
- [Window](reference/apis/js-apis-window.md)
- [Display](reference/apis/js-apis-display.md)
- [Update](reference/apis/js-apis-update.md)
- [USB](reference/apis/js-apis-usb.md)
- [Location](reference/apis/js-apis-geolocation.md)
- Basic Features
- [Application Context](reference/apis/js-apis-basic-features-app-context.md)
- [Console Logs](reference/apis/js-apis-basic-features-logs.md)
- [Page Routing](reference/apis/js-apis-basic-features-routes.md)
- [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md)
- [Application Configuration](reference/apis/js-apis-basic-features-configuration.md)
- [Timer](reference/apis/js-apis-basic-features-timer.md)
- [Setting the System Time](reference/apis/js-apis-system-time.md)
- [Animation](reference/apis/js-apis-basic-features-animator.md)
- [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md)
- [Screenshot](reference/apis/js-apis-screenshot.md)
- DFX
- [HiAppEvent](reference/apis/js-apis-hiappevent.md)
- [Performance Tracing](reference/apis/js-apis-hitracemeter.md)
- [Fault Logger](reference/apis/js-apis-faultLogger.md)
- [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md)
- [HiLog](reference/apis/js-apis-hilog.md)
- [HiChecker](reference/apis/js-apis-hichecker.md)
- [HiDebug](reference/apis/js-apis-hidebug.md)
- Language Base Class Library
- [Obtaining Process Information](reference/apis/js-apis-process.md)
- [URL String Parsing](reference/apis/js-apis-url.md)
- [URI String Parsing](reference/apis/js-apis-uri.md)
- [Util](reference/apis/js-apis-util.md)
- [XML Parsing and Generation](reference/apis/js-apis-xml.md)
- [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md)
- [Worker Startup](reference/apis/js-apis-worker.md)
- [Linear Container ArrayList](reference/apis/js-apis-arraylist.md)
- [Linear Container Deque](reference/apis/js-apis-deque.md)
- [Linear Container List](reference/apis/js-apis-list.md)
- [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md)
- [Linear Container Queue](reference/apis/js-apis-queue.md)
- [Linear Container Stack](reference/apis/js-apis-stack.md)
- [Linear Container Vector](reference/apis/js-apis-vector.md)
- [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md)
- [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md)
- [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md)
- [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md)
- [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md)
- [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md)
- [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md)
\ No newline at end of file
# Ability开发 # Ability开发
- [Ability框架概述](ability-brief.md) - [Ability框架概述](ability-brief.md)
- FA模型 - FA模型
- [FA模型综述](fa-brief.md) - [FA模型综述](fa-brief.md)
- [PageAbility开发指导](fa-pageability.md) - [PageAbility开发指导](fa-pageability.md)
- [ServiceAbility开发指导](fa-serviceability.md) - [ServiceAbility开发指导](fa-serviceability.md)
- [DataAbility开发指导](fa-dataability.md) - [DataAbility开发指导](fa-dataability.md)
- [FormAbility开发指导](fa-formability.md) - [FormAbility开发指导](fa-formability.md)
- Stage模型 - Stage模型
- [Stage模型综述](stage-brief.md)
- [Ability开发指导](stage-ability.md)
- [ServiceExtensionAbility开发指导](stage-serviceextension.md) - [ServiceExtensionAbility开发指导](stage-serviceextension.md)
- [FormExtensionAbility开发指导](stage-formextension.md) - [跨端迁移开发指导](stage-ability-continuation.md)
- [应用迁移开发指导](stage-ability-continuation.md) - [Call调用开发指导](stage-call.md)
- 其他 - 其他
- [WantAgent使用指导](wantagent.md) - [WantAgent使用指导](wantagent.md)
- [Ability助手使用指导](ability-assistant-guidelines.md) - [Ability助手使用指导](ability-assistant-guidelines.md)
\ No newline at end of file - [测试框架使用指导](ability-delegator.md)
\ No newline at end of file
# 测试框架使用指导
Delegator测试框架是OpenHarmony提供的一套开发者应用自测试框架,旨在为开发者提供针对应用的自测试环境。开发者可以通过delegator类启动对应Ability,并通过Delegator类提供的能力对Ability进行生命周期切换和监听,同时支持shellCMD输入和测试结果打印显示等功能。
## 测试框架启动
测试框架启动有两种方式,方式一:通过aa test命令启动,方式二:通过IDE启动。
### aa test启动
开发者可通过 aa test 命令启动启动测试框架,开发者可以自行指定使用的runner以及runner所在hap包的package name/module name,具体命令示例如下:
**FA模型:**
```javascript
aa test -p com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
```
**Stage模型:**
```javascript
aa test -m com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20
```
| 参数 | 是否必选 | 参数说明 |
| --------------- | -------- | ------------------------------------------------------------ |
| -p | 是 | TestRunner所在hap包的package name,FA模型使用。 |
| -m | 是 | TestRunner所在hap包的module name,stage模型使用。 |
| -s unittest | 是 | 启用的TestRunner名称,TestRunner名称和文件名需要保持一致。 |
| -w | 否 | 测试用例超时时间,如果未指定,测试框架会一直等待测试代码调用finishTest才退出。 |
| -s <key><value> | 否 | 支持以key-value的方式输入任何参数,输入的参数可通过AbilityDelegatorArgs.parameters以key-value的方式获取。 |
### IDE启动
IDE文档中介绍,待IDE文档上库补充链接。
## TestRunner介绍
TestRunner是测试框架测试流程入口类,当测试流程启动时,系统会调用TestRunner内相关接口,开发者需要派生该类,并重写onPrepare、onRun方法。IDE在创建应用模板时会初始化一个默认TestRunner,并在onRun方法启动默认的TestAbility。开发者也可以修改TestAbility测试代码内容,也可以修改默认的TestRunner内onPrepare、onRun方法,自行实现测试代码。具体详细内容请参考TestRunnerAPI接口说明[TestRunner](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-testRunner.md)
## AbilityMonitor介绍
AbilityMonitor是测试框架提供用来绑定并监听Ability类,开发者可以使用AbilityMonitor绑定Ability,并将AbilityMonitor添加到监听列表。绑定后Ability的创建、生命周期变化等会触发AbilityMonitor内相关回调函数,开发者可以在对应回调函数内进行测试验证。具体详细内容请参考AbilityMonitor API接口说明[AbilityMonitor](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-abilityMonitor.md)
**示例**
```javascript
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.addAbilityMonitor(monitor).then((void) => {
console.info("addAbilityMonitor promise");
});
```
## AbilityDelegator介绍
AbilityDelegator是测试框架主要功能类,提供了启动Ability、获取Ability示例、调度Ability生命周期、对Ability生命周期进行监听、打印测试结果等功能。
**导入模块**
```javascript
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
```
```javascript
var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
```
### 启动Ability并监听Ability状态变化
配合AbilityMonitor使用,可以实现对Ability启动、Ability实例获取、监听状态变化功能。
**示例:**
```javascript
var abilityDelegator;
var ability;
var timeout = 100;
function onAbilityCreateCallback() {
console.info("onAbilityCreateCallback");
}
var monitor = {
abilityName: "abilityname",
onAbilityCreate: onAbilityCreateCallback
}
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.waitAbilityMonitor(monitor, timeout, (err, data) => {
ability = data;
console.info("waitAbilityMonitor callback");
});
var want = {
bundleName: "bundleName",
abilityName: "abilityName"
};
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.startAbility(want, (err, data) => {
console.info("startAbility callback");
});
```
### 调度Ability生命周期
AbilityDelegator提供对Ability生命周期进行显示调度,支持Foreground、Background,配合AbilityMonitor中对Ability生命周期监听方法,可以完整的测试Ability生命周期变化。具体详细内容请参考AbilityDelegator API接口说明[AbilityDelegator](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md#abilitydelegator)
### 执行shellCMD命令
AbilityDelegator提供执行shellCMD命令功能,开发者可以在测试代码中执行shell命令,该功能仅在测试环境中生效,非测试环境该接口调用无效果。
**示例:**
```javascript
var abilityDelegator;
var cmd = "cmd";
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
abilityDelegator.executeShellCommand(cmd, (err,data) => {
console.info("executeShellCommand callback");
});
```
\ No newline at end of file
...@@ -186,4 +186,10 @@ var promise = await featureAbility.startAbility({ ...@@ -186,4 +186,10 @@ var promise = await featureAbility.startAbility({
}, },
} }
); );
``` ```
\ No newline at end of file ## 开发实例
针对pageAbility开发,有以下示例工程可供参考:
- [DMS](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS)
在本示例中完整展示了启动本地Ability、启动远程Ability的使用方法。
\ No newline at end of file
# 应用迁移开发指导 # 跨端迁移开发指导
## 场景介绍 ## 场景介绍
迁移的主要工作是实现将应用当前任务,包括页面部分数据、栈信息等,迁移到远端设备。迁移成功后,本端任务将被清除;若失败则不会,可允许再次迁移。 迁移的主要工作是实现将应用当前任务,包括页面控件状态变量、分布式对象等,迁移到远端设备。页面控件状态变量用于同步页面UI数据,分布式对象用于同步内存中的数据。
## 接口说明 ## 接口说明
迁移提供的能力如下,具体的API详见接口文档 迁移提供的能力如下,具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-ability.md)
**表1** 应用迁移API接口功能介绍 **表1** 应用迁移API接口功能介绍
|接口名 | 描述| |接口名 | 描述|
|:------ | :------| |:------ | :------|
| onContinue(wantParams : {[key: string]: any}) | 迁移发起端在该回调中保存迁移所需要的数据,同时返回是否同意迁移:true表示同意,false表示拒绝。 | | onContinue(wantParams : {[key: string]: any}): OnContinueResult | 迁移**发起端**在该回调中保存迁移所需要的数据,同时返回是否同意迁移:0表示同意,拒绝返回相应错误码。 |
| onCreate(want: Want,param:LaunchParam): void | 迁移**目标端**在该回调中完成数据恢复,并触发页面恢复。 |
| **enum** OnContinueResult | onContinue的返回值类型:AGREE表示同意;REJECT表示拒绝;MISMATCH表示版本不匹配 |
## 开发步骤 **图1** 迁移开发示意图
### 迁移应用 ![continuation_dev](figures/continuation-info.png)
## 开发步骤
### 迁移应用
1. 配置 1. 配置
- 配置应用支持迁移 - 配置应用支持迁移
​ 在config.json中配置continuable字段:true表示支持迁移,false表示不支持,默认为false. 在module.json5中配置continuable字段:true表示支持迁移,false表示不支持,默认为false。配置为false的应用将被系统识别为无法迁移。
``` ```javascript
"continuable": true "continuable": true
``` ```
​ 配置为false的应用将无法在任务中心进行迁移。
* 配置应用启动类型 * 配置应用启动类型
​ 迁移当前只支持多实例应用,需要在在config.json中配置launchType字段为standard 迁移当前只支持多实例应用,需要在在module.json5中配置launchType字段为standard
``` ```javascript
"launchType": "standard" "launchType": "standard"
``` ```
* 申请分布式权限
支持跨端迁移的应用需要在module.json5申请分布式权限 DISTRIBUTED_DATASYNC。
```javascript
"requestPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
```
这个权限需要在应用首次启动的时候弹窗让用户授予,可以通过在ability的onWindowStageCreate中添加如下代码实现
```javascript
requestPermissions = async () => {
let permissions: Array<string> = [
"ohos.permission.DISTRIBUTED_DATASYNC"
];
let needGrantPermission = false
let accessManger = accessControl.createAtManager()
Logger.info("app permission get bundle info")
let bundleInfo = await bundle.getApplicationInfo(BUNDLE_NAME, 0, 100)
Logger.info(`app permission query permission ${bundleInfo.accessTokenId.toString()}`)
for (const permission of permissions) {
Logger.info(`app permission query grant status ${permission}`)
try {
let grantStatus = await accessManger.verifyAccessToken(bundleInfo.accessTokenId, permission)
if (grantStatus === PERMISSION_REJECT) {
needGrantPermission = true
break;
}
} catch (err) {
Logger.error(`app permission query grant status error ${permission} ${JSON.stringify(err)}`)
needGrantPermission = true
break;
}
}
if (needGrantPermission) {
Logger.info("app permission needGrantPermission")
try {
await this.context.requestPermissionsFromUser(permissions)
} catch (err) {
Logger.error(`app permission ${JSON.stringify(err)}`)
}
} else {
Logger.info("app permission already granted")
}
}
```
2. 实现onContinue接口 2. 实现onContinue接口
导入模块 onContinue接口在**发起端**被调用,主要用于在迁移发起时,通知开发者保存控件状态变量和内存中数据,准备迁移。当应用准备完成后,需要返回OnContinueResult.AGREE(0)表示同意迁移,否则返回相应的错误码拒绝迁移。如果不实现该接口,系统将默认为拒绝迁移。
``` 导入模块
```javascript
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
import AbilityConstant from '@ohos.application.AbilityConstant';
``` ```
- 要实现迁移,此接口必须实现并返回true,否则默认为拒绝迁移。 - 要实现迁移,此接口必须实现并返回AGREE,否则默认为拒绝迁移。
- 示例 - 示例
```javascript ```javascript
onContinue(wantParams : {[key: string]: any}) { onContinue(wantParam : {[key: string]: any}) {
console.log("MainAbility onContinue") Logger.info("onContinue using distributedObject")
return true; // set user input data into want params
} wantParam["input"] = AppStorage.Get<string>('ContinueInput');
Logger.info(`onContinue input = ${wantParam["input"]}`);
return AbilityConstant.OnContinueResult.AGREE
}
``` ```
3. 在onCreate接口中实现迁移逻辑 3. 在onCreate接口中实现迁移逻辑
- 远端设备上,在onCreate中根据launchReason判断该次启动是否为迁移LaunchReason.CONTINUATION(3) onCreate接口在迁移**目标端**被调用,在目标端ability被拉起时,通知开发者同步已保存的内存数据和控件状态,完成后触发页面的恢复。如果不实现该接口中迁移相关逻辑,ability将会作为普通的启动方式拉起,无法恢复页面。
- 远端设备上,在onCreate中根据launchReason判断该次启动是否为迁移LaunchReason.CONTINUATION
- 完成数据恢复后,开发者需要调用**restoreWindowStage**来触发页面恢复。 - 完成数据恢复后,开发者需要调用**restoreWindowStage**来触发页面恢复。
* 示例 * 示例
```javascript ```javascript
onCreate(want , launchParam) { onCreate(want, launchParam) {
// Ability is creating, initialize resources for this ability Logger.info(`MainAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`)
console.log("MainAbility onCreate", launchParam.launchReason); globalThis.abilityWant = want;
if (launchParam.launchReason == LaunchReason.CONTINUATION) { if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) {
this.contentStorage = new ContenStorage(); let input = want.parameters.input // get user data from want params
AppStorage.SetOrCreate<string>('ContinueInput', input)
Logger.info(`onCreate for continuation sessionId: ${this.sessionId}`)
this.contentStorage = new ContentStorage();
this.context.restoreWindowStage(this.contentStorage); this.context.restoreWindowStage(this.contentStorage);
} }
} }
``` ```
### 迁移数据 ### 迁移数据
1. 使用自定义数据 1. 使用分布式对象
- wantParams中可以填写key-value形式自定义数据,key类型string,填充的数据将随want被传输到远端,用于携带一些简单、轻量的数据 分布式数据对象提供了与本地变量类似的操作,实现两个设备的数据同步,当设备1的应用A的分布式数据对象增、删、改数据后,设备2的应用A也可以获取到对应的数据变化,同时还能监听数据变更以及对端数据对象的上下线。用法详见[分布式对象指导文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/database/database-distributedobject-guidelines.md)
迁移场景中,分布式对象(distributedDataObject)主要用于将本机内存数据同步到目标设备。
```javascript - 发起端在onContinue中,将待迁移的数据存入分布式对象中,然后设置好session id,并通过wantParams将session id传到远端设备。
onContinue(wantParams : {[key: string]: any}) {
console.log("Continue My Data")
wantParams["myData"] = "my1234567";
return true;
}
```
- 同时在远端判断如果是迁移,可以从want.parameters中取出在发起端保存的自定义数据。
```javascript ```javascript
onCreate(want , launchParam) { import Ability from '@ohos.application.Ability';
if (launchParam.launchReason == LaunchReason.CONTINUATION) { import distributedObject from '@ohos.data.distributedDataObject';
console.log("onCreate LaunchReason = CONTINUATION",want.parameters["myData"]); // my1234567
... var g_object = distributedObject.createDistributedObject({name:undefined});
this.context.restoreWindowStage(this.contentStorage);
} export default class MainAbility extends Ability {
contentStorage : ContenStorage
sessionId : string;
onContinue(wantParam : {[key: string]: any}) {
Logger.info("onContinue using distributedObject")
this.sessionId = distributedObject.genSessionId();
//set distributed data object session id
g_object.setSessionId(this.sessionId);
g_object.name = "Amy";
// set session id into want params
wantParam["session"] = this.sessionId;
return AbilityConstant.OnContinueResult.AGREE
} }
``` ```
- 目标设备在onCreate中,取出发起端传过来的session id,建立分布式对象并关联该session id,这样就能实现分布式对象的同步。需要注意的是,在调用restoreWindowStage之前,迁移需要的分布式对象必须全部关联完,保证能够获取到正确的数据。
2. 使用分布式对象
使用分布式对象可以传输更多的数据到远端设备,更多用法详见分布式对象接口文档。
- 发起端在onContinue中,将待迁移的数据存入分布式对象中,然后设置好session id,并通过wantParams将session id传到远端设备。
- 远端设备在onCreate中,取出发起端传过来的session id,建立分布式对象并关联该session id,这样就能实现分布式对象的同步。需要注意的是,在调用restoreWindowStage之前,迁移需要的分布式对象必须全部关联完,保证能够获取到正确的数据。
* 示例
```javascript ```javascript
import Ability from '@ohos.application.Ability'; import Ability from '@ohos.application.Ability';
import distributedObject from '@ohos.data.distributedDataObject'; import distributedObject from '@ohos.data.distributedDataObject';
var g_object = distributedObject.createDistributedObject({name:undefined}); var g_object = distributedObject.createDistributedObject({name:undefined});
export default class MainAbility extends Ability { export default class MainAbility extends Ability {
contentStorage : ContenStorage contentStorage : ContentStorage
sessionId : string; sessionId : string;
onCreate(want , launchParam) {
if (launchParam.launchReason == 3) { statusCallback(sessionId, networkid, status) {
this.sessionId = want.parameters["session"] // 取出session id Logger.info(`continuation object status change, sessionId: ${sessionId}, status: ${status}, g_object.name: ${g_object.name}`)
}
function statusCallback(sessionId, networkid, status) {
console.info("object status change sessionId: " + sessionId + " status: " + status + onCreate(want, launchParam) {
"g_object.name: " + g_object.name); // 回调中可以取到同步过来的分布式对象内容 name = Amy Logger.info(`MainAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`)
} if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) {
g_object.on("status", statusCallback); // 注册分布式对象同步结果的监听 // get distributed data object session id from want params
this.sessionId = want.parameters.session
g_object.setSessionId(this.sessionId); // 将本地分布式对象也关联发起端的session id Logger.info(`onCreate for continuation sessionId: ${this.sessionId}`)
this.contentStorage = new ContenStorage(); g_object.on("status", this.statusCallback);
this.context.restoreWindowStage(this.contentStorage); // set session id, so it will sync data from remote device
} g_object.setSessionId(this.sessionId);
}
this.contentStorage = new ContentStorage();
onContinue(wantParams : {[key: string]: any}) { this.context.restoreWindowStage(this.contentStorage);
console.log("using distributedObject") }
this.sessionId = "654321"; }
g_object.setSessionId(this.sessionId); //1 设置分布式对象的session id }
g_object.name = "Amy"; // 填入数据
wantParams["session"] = this.sessionId; // 将session id 通过want传到远端
return true;
}
``` ```
以上完整的示例见sample
# Ability开发指导 # Ability开发指导
\ No newline at end of file ## 场景介绍
Stage模型是基于API version 9的应用开发模型,对此模型的介绍详见[Stage模型综述](stage-brief.md)。基于Stage模型的Ability应用开发,主要涉及如下功能逻辑:
- 创建Page Ability应用,如视频播放、新闻资讯等,需要通过屏幕进行浏览的应用,以及支持人机交互。
- 获取Ability的配置信息,如ApplicationInfo、AbilityInfo及HapModuleInfo等。
- 启动/带参数启动/带返回结果启动/带AccountId启动其他Ability。
- 应用向用户申请授权。
- 系统环境变化通知给AbilityStage及Ability。
- 通用组件Call功能,详见[Call调用开发指导](stage-call.md)
- 连接ServiceAbility,与ServiceAbility断开连接,详见[ServiceExtensionAbility开发指导](stage-serviceextension.md)
- 应用迁移,详见[应用迁移开发指导](stage-ability-continuation.md)
## 接口说明
AbilityStage功能如下:AbilityStage类,拥有context属性,具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-abilitystage.md)
**表1** AbilityStage API接口功能介绍
|接口名|描述|
|:------|:------|
|void onCreate()|AbilityStage初始化时被调用。|
|string onAcceptWant(want: Want)|启动指定Ability时被调用。|
|void onConfigurationUpdated(config: Configuration)|全局配置发生变更时被调用。|
Ability功能如下:Ability类,具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-ability.md)
**表2** Ability API接口功能介绍
|接口名|描述|
|:------|:------|
|void onCreate(want: Want, param: AbilityConstant.LaunchParam)|Ability生命周期回调,Ability启动时被调用。|
|void onDestroy()|Ability生命周期回调,Ability销毁时被调用。|
|void onWindowStageCreate(windowStage: window.WindowStage)|Ability生命周期回调,创建window stage时被调用,应用开发者可通过window.WindowStage的接口执行页面加载等操作。|
|void onWindowStageDestroy()|Ability生命周期回调,销毁window stage时被调用。|
|void onForeground()|Ability生命周期回调,Ability切换至前台时被调用。|
|void onBackground()|Ability生命周期回调,Ability切换至后台时被调用。|
|void onNewWant(want: Want)|Ability回调,Ability的启动模式设置为单例时被调用。|
|void onConfigurationUpdated(config: Configuration)|Ability回调,Ability的系统配置更新时被调用。|
Ability类拥有context属性,context属性为AbilityContext类,AbilityContext类拥有abilityInfo、currentHapModuleInfo等属性,具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-ability-context.md)
**表3** AbilityContext API接口功能介绍
|接口名|描述|
|:------|:------|
|void startAbility(want: Want, callback: AsyncCallback<void>)|启动Ability。|
|void startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>)|启动Ability。|
|void startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback<void>)|带AccountId启动Ability。|
|void startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>)|带AccountId启动Ability。|
|void startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>)|带返回结果启动Ability。|
|void startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>)|带返回结果启动Ability。|
|void startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback<AbilityResult>)|带返回结果及AccountId启动Ability。|
|void startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback<void>)|带返回结果及AccountId启动Ability。|
|void terminateSelf(callback: AsyncCallback<void>)|销毁当前的Page Ability。|
|void terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>)|带返回结果销毁当前的Page Ability。|
## 开发步骤
### 创建Page Ability应用
创建Stage模型的Page Ability应用,需实现AbilityStage接口及Ability生命周期接口,并使用窗口提供的方法设置页面。具体示例代码如下:
1. 导入AbilityStage模块
```
import AbilityStage from "@ohos.application.AbilityStage"
```
2. 实现AbilityStage接口
```ts
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
}
}
```
3. 导入Ability模块
```
import Ability from '@ohos.application.Ability'
```
4. 实现Ability生命周期接口
`onWindowStageCreate(windowStage)`中通过loadContent接口设置应用要加载的页面,window接口的使用详见[窗口开发指导](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/windowmanager/window-guidelines.md/)
```ts
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("MainAbility onCreate")
}
onDestroy() {
console.log("MainAbility onDestroy")
}
onWindowStageCreate(windowStage) {
console.log("MainAbility onWindowStageCreate")
windowStage.loadContent("pages/index").then((data) => {
console.log("MainAbility load content succeed with data: " + JSON.stringify(data))
}).catch((error) => {
console.error("MainAbility load content failed with error: "+ JSON.stringify(error))
})
}
onWindowStageDestroy() {
console.log("MainAbility onWindowStageDestroy")
}
onForeground() {
console.log("MainAbility onForeground")
}
onBackground() {
console.log("MainAbility onBackground")
}
}
```
### 获取AbilityStage及Ability的配置信息
AbilityStage类及Ability类均拥有context属性,应用可以通过`this.context`获取Ability实例的上下文,进而获取详细的配置信息。如下示例展示了AbilityStage通过context属性获取包代码路径、hap包名、ability名以及系统语言的方法。具体示例代码如下:
```ts
import AbilityStage from "@ohos.application.AbilityStage"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let context = this.context
console.log("MyAbilityStage bundleCodeDir" + context.bundleCodeDir)
let currentHapModuleInfo = context.currentHapModuleInfo
console.log("MyAbilityStage hap module name" + currentHapModuleInfo.name)
console.log("MyAbilityStage hap module mainAbilityName" + currentHapModuleInfo.mainAbilityName)
let config = this.context.config
console.log("MyAbilityStage config language" + config.language)
}
}
```
如下示例展示了Ability通过context属性获取包代码路径、hap包名、ability名以及系统语言的方法。具体示例代码如下:
```ts
import Ability from '@ohos.application.Ability'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("MainAbility onCreate")
let context = this.context
console.log("MainAbility bundleCodeDir" + context.bundleCodeDir)
let abilityInfo = this.context.abilityInfo;
console.log("MainAbility ability bundleName" + abilityInfo.bundleName)
console.log("MainAbility ability name" + abilityInfo.name)
let config = this.context.config
console.log("MyAbilityStage config language" + config.language)
}
}
```
### 启动Ability
应用可以通过`this.context`获取Ability实例的上下文,进而使用AbilityContext中的StartAbility相关接口启动Ability。启动Ability可指定Want、StartOptions、accountId,通过callback形式或promise形式实现。具体示例代码如下:
```ts
let context = this.context
var want = {
"deviceId": "",
"bundleName": "com.example.MyApplication",
"abilityName": "MainAbility"
};
var options = {
windowMode: 0,
displayId: 2
};
context.startAbility(want, options).then((data) => {
console.log("Succeed to start ability with data: " + JSON.stringify(data))
}).catch((error) => {
console.error("Failed to start ability with error: "+ JSON.stringify(error))
})
```
### 应用向用户申请授权
应用需要某些权限如存储、位置信息、访问日历时,需要向用户申请授权。具体示例代码如下:
```ts
let context = this.context
let permissions = ohos.permission.READ_CALENDAR
context.requestPermissionsFromUser(permissions).then((data) => {
console.log("Succeed to request permission from user with data: "+ JSON.stringify(data))
}).catch((error) => {
console.log("Failed to request permission from user with error: "+ JSON.stringify(error))
})
```
### 系统环境变化通知给AbilityStage及Ability
全局配置,比如系统语言和颜色模式发生变化时,通过onConfigurationUpdated接口通知给AbilityStage和Ability。如下示例展示了AbilityStage的onConfigurationUpdated回调实现,系统语言和颜色模式发生变化时触发该回调。具体示例代码如下:
```ts
import Ability from '@ohos.application.Ability'
import ConfigurationConstant from '@ohos.application.ConfigurationConstant'
export default class MyAbilityStage extends AbilityStage {
onConfigurationUpdated(config) {
console.log("MyAbilityStage onConfigurationUpdated")
console.log("MyAbilityStage config language" + config.language)
console.log("MyAbilityStage config colorMode" + config.colorMode)
}
}
```
如下示例展示了Ability的onConfigurationUpdated回调实现,系统语言、颜色模式以及Display相关的参数,比如方向、Density,发生变化时触发该回调。具体示例代码如下:
```ts
import Ability from '@ohos.application.Ability'
import ConfigurationConstant from '@ohos.application.ConfigurationConstant'
export default class MainAbility extends Ability { {
onConfigurationUpdated(config) {
console.log("MainAbility onConfigurationUpdated")
console.log("MainAbility config language" + config.language)
console.log("MainAbility config colorMode" + config.colorMode)
console.log("MainAbility config direction" + config.direction)
console.log("MainAbility config screenDensity" + config.screenDensity)
console.log("MainAbility config displayId" + config.displayId)
}
}
```
## 开发实例
针对Stage模型Ability开发,有以下示例工程可供参考:
[eTSStageCallAbility]()
本示例eTSStageCallAbility中,在Application目录的AbilityStage.ts中实现AbilityStage的接口,在MainAbility目录实现Ability的接口并设置"pages/index"中的内容为Ability的界面,在SecondAbility目录实现另一个Ability并设置"pages/second"为Ability的界面。支持MainAbility启动SecondAbility。
\ No newline at end of file
# Call调用开发指导
## 场景介绍
Ability Call调用是Ability能力的扩展,它为Ability提供一种能够被外部调用的能力。使Ability既能被拉起到前台展示UI,也支持Ability在后台被创建并运行。应用开发者可通过Call调用,使用IPC通信实现不同Ability之间的数据共享。Call调用的场景主要包括:
- 创建Callee被调用端。
- 访问Callee被调用端。
本文中的Caller和Callee分别表示调用者和被调用者,Call调用流程示意图如下。
![stage-call](figures/stage-call.png)
## 接口说明
Caller及Callee功能如下:具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-ability.md#caller)
**表1** Call API接口功能介绍
|接口名|描述|
|:------|:------|
|Promise<Caller> startAbilityByCall(want: Want)|获取指定通用组件的Caller通信接口,拉起指定通用组件并将其切换到后台。|
|void on(method: string, callback: CaleeCallBack)|Callee.on,通用组件Callee注册method对应的callback方法。|
|void off(method: string)|Callee.off,通用组件Callee去注册method的callback方法。|
|Promise<void> call(method: string, data: rpc.Sequenceable)|Caller.call,向通用组件Callee发送约定序列化数据。|
|Promise<rpc.MessageParcel> callWithResult(method: string, data: rpc.Sequenceable)|Caller.callWithResult,向通用组件Callee发送约定序列化数据, 并将返回的约定序列化数据带回。|
|void release()|Caller.release,释放通用组件的Caller通信接口。|
|void onRelease(callback: OnReleaseCallBack)|Caller.onRelease,注册通用组件通信断开监听通知。|
## 开发步骤
### 创建Callee被调用端
Callee被调用端,需要实现指定方法的数据接收回调函数、数据的序列化及反序列化方法。在需要接收数据期间,通过on接口注册监听,无需接收数据时通过off接口解除监听。
1. 配置Ability的启动模式
配置module.json5,将Callee被调用端所在的Ability配置为单实例"singleton"。
|Json字段|字段说明|
|:------|:------|
|"launchType"|Ability的启动模式,设置为"singleton"类型 |
Ability配置标签示例如下:
```json
"abilities":[{
"name": ".CalleeAbility",
"srcEntrance": "./ets/CalleeAbility/CalleeAbility.ts",
"launchType": "singleton",
"description": "$string:CalleeAbility_desc",
"icon": "$media:icon",
"label": "$string:CalleeAbility_label",
"visible": true
}]
```
2. 导入Ability模块
```
import Ability from '@ohos.application.Ability'
```
3. 定义约定的序列化数据
调用端及被调用端发送接收的数据格式需协商一致,如下示例约定数据由number和string组成。具体示例代码如下:
```ts
export class MySequenceable {
num: number = 0
str: String = ""
constructor(num, string) {
this.num = num
this.str = string
}
marshalling(messageParcel) {
messageParcel.writeInt(this.num)
messageParcel.writeString(this.str)
return true
}
unmarshalling(messageParcel) {
this.num = messageParcel.readInt()
this.str = messageParcel.readString()
return true
}
}
```
4. 实现Callee.on监听及Callee.off解除监听
被调用端Callee的监听函数注册时机, 取决于应用开发者。注册监听之前的数据不会被处理,取消监听之后的数据不会被处理。如下示例在Ability的onCreate注册'CalleeSortMethod'监听,在onDestroy取消监听,收到序列化数据后对字符串排序后返回,应用开发者根据实际需要做相应处理。具体示例代码如下:
```ts
let TAG = '[CalleeAbility] '
let method = 'CalleeSortMethod'
function CalleeSortFunc(data) {
let receiveData = new MySequenceable(0, '')
data.readSequenceable(receiveData)
console.log(TAG + 'receiveData[' + receiveData.num + ',' + receiveData.str + ']')
return new MySequenceable(receiveData.num + 1, Array.from(receiveData.str).sort().join(''))
}
export default class CalleeAbility extends Ability {
onCreate(want, launchParam) {
try {
this.callee.on(method, CalleeSortFunc)
} catch (error) {
console.error(TAG + method + 'register failed with error: ' + JSON.stringify(error))
}
}
onDestroy() {
try {
this.callee.off(method)
} catch (error) {
console.error(TAG + method + 'unregister failed with error: ' + JSON.stringify(error))
}
}
}
```
### 访问Callee被调用端
1. 导入Ability模块
```
import Ability from '@ohos.application.Ability'
```
2. 获取Caller通信接口
Ability的context属性实现了startAbilityByCall方法,用于获取指定通用组件的Caller通信接口。如下示例通过`this.context`获取Ability实例的context属性,使用startAbilityByCall拉起Callee被调用端并获取Caller通信接口,注册Caller的onRelease监听。应用开发者根据实际需要做相应处理。具体示例代码如下:
```ts
let TAG = '[MainAbility] '
var caller = undefined
let context = this.context
context.startAbilityByCall({
bundleName: 'com.samples.CallApplication',
abilityName: 'CalleeAbility'
}).then((data) => {
if (data != null) {
caller = data
console.log(TAG + 'get caller success')
// 注册caller的release监听
caller.onRelease((msg) => {
console.log(TAG + 'caller onRelease is called ' + msg)
})
console.log(TAG + 'caller register OnRelease succeed')
}
}).catch((error) => {
console.error(TAG + 'get caller failed with ' + error)
})
```
3. 发送约定序列化数据
向被调用端发送Sequenceable数据有两种方式,一种是不带返回值,一种是获取被调用端返回的数据,method以及序列化数据需要与被调用端协商一致。如下示例调用Call接口,向Calee被调用端发送数据。具体示例代码如下:
```ts
let method = 'CalleeSortMethod'
let msg = new MySequenceable(1, 'call_str')
caller.call(method, msg).then(() => {
console.log(TAG + 'caller call succeed')
}).catch((error) => {
console.error(TAG + 'caller call failed with ' + error)
})
```
如下示例调用CallWithResult接口,向Calee被调用端发送待处理的数据,并将method方法处理完毕的数据赋值给callback。具体示例代码如下:
```ts
let method = 'CalleeSortMethod'
let msg = new MySequenceable(1, sortString)
caller.callWithResult(method, msg)
.then((data) => {
let resultMsg = new MySequenceable(0, '')
data.readSequenceable(resultMsg)
callback(resultMsg.str)
console.log(TAG + 'caller result is [' + resultMsg.num + ',' + resultMsg.str + ']')
}).catch((error) => {
console.error(TAG + 'caller callWithResult failed with ' + error)
})
```
4. 释放Caller通信接口
Caller不再使用后,应用开发者可以通过release接口释放Caller。具体示例代码如下:
```ts
try {
caller.release()
caller = undefined
console.log(TAG + 'caller release succeed')
} catch (error) {
console.error(TAG + 'caller release failed with ' + error)
}
```
## 开发实例
针对Stage模型本地Call功能开发,有以下示例工程可供参考:
[eTSStageCallAbility]()
本示例eTSStageCallAbility中,在Application目录的AbilityStage.ts中实现AbilityStage的接口,在MainAbility目录实现Ability的接口并设置"pages/index"为应用的界面,在CaleeAbility目录实现Callee被调用端。MainAbility获取Caller通信接口后,支持用户输入字符串,做序列化处理后传递给CaleeAbility被调用端处理,Calee将字符串排序,返回序列化数据并将排序结果显示在页面上。
\ No newline at end of file
...@@ -6,191 +6,31 @@ ...@@ -6,191 +6,31 @@
## 导入模块 ## 导入模块
requestAnimationFrame:无需导入
cancelAnimationFrame:无需导入
createAnimator:
``` ```
import animator from '@ohos.animator'; import animator from '@ohos.animator';
``` ```
## 权限列表
## createAnimator
## requestAnimationFrame createAnimator(options: AnimatorOptions): AnimatorResult
requestAnimationFrame(handler[, [ ...args]]): number 定义Animator类。
请求动画帧,逐帧回调JS函数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full
- 参数 **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| handler | Function | 是 | 表示要逐帧回调的函数。requestAnimationFrame函数回调handler函数时会在第一个参数位置传入timestamp时间戳。它表示requestAnimationFrame开始去执行回调函数的时刻。 | | options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项,详细请参考AnimatorOptions。|
| ...args | Array&lt;any&gt; | 否 | 附加参数,函数回调时,他们会作为参数传递给handler。 |
- 返回值 **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| number | requestID请求的ID。 | | [AnimatorResult](#animatorresult) | Animator结果接口。 |
- 示例
```
<!-- xxx.hml -->
<div class="container">
<button type="capsule" class="btn" onclick="beginAnimation">beginAnimation</button>
</div>
```
```
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.btn{
width: 300px;
margin-top: 40px;
}
```
```
/* xxx.js */
export default {
data: {
requestId: 0,
startTime: 0,
},
beginAnimation() {
cancelAnimationFrame(this.requestId);
this.requestId = requestAnimationFrame(this.runAnimation);
},
runAnimation(timestamp) {
if (this.startTime == 0) {
this.startTime = timestamp;
}
var elapsed = timestamp - this.startTime;
if (elapsed < 500) {
console.log('callback handler timestamp: ' + timestamp);
this.requestId = requestAnimationFrame(this.runAnimation);
}
}
}
```
## cancelAnimationFrame
cancelAnimationFrame(requestId: number): void
取消动画帧,取消逐帧回调请求。
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| requestId | number | 是 | 逐帧回调函数的标识id。 |
- 示例
```
<!-- xxx.hml -->
<div class="container">
<button type="capsule" class="btn" onclick="beginAnimation">beginAnimation</button>
<button type="capsule" class="btn" onclick="stopAnimation">stopAnimation</button>
</div>
```
``` **示例:**
/* xxx.css */
.container {
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.btn{
width: 300px;
margin-top: 40px;
}
```
```
/* xxx.js */
export default {
data: {
requestId: 0,
startTime: 0,
},
beginAnimation() {
cancelAnimationFrame(this.requestId);
this.requestId = requestAnimationFrame(this.runAnimation);
},
runAnimation(timestamp) {
if (this.startTime == 0) {
this.startTime = timestamp;
}
var elapsed = timestamp - this.startTime;
if (elapsed < 500) {
console.log('callback handler timestamp: ' + timestamp);
this.requestId = requestAnimationFrame(this.runAnimation);
}
},
stopAnimation() {
cancelAnimationFrame(this.requestId);
}
}
```
## createAnimator
createAnimator(options[...]): void
创建动画对象。
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | Object | 是 | 表示待创建Animator对象的属性,详情见下表options说明。 |
- options说明
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| duration | number | 否 | 动画播放的时长,单位毫秒,默认为0。 |
| easing | string | 否 | 动画插值曲线,默认为'&nbsp;ease&nbsp;'。 |
| delay | number | 否 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 |
| fill | string | 否 | 动画启停模式,默认值none,详情见:[animation-fill-mode](../arkui-js/js-components-common-animation.md) |
| direction | string | 否 | 动画播放模式,默认值normal,详情见:[animation-direction](../arkui-js/js-components-common-animation.md) |
| iterations | number | 否 | 动画播放次数,默认值1,设置为0时不播放,设置为-1时无限次播放。 |
| begin | number | 否 | 动画插值起点,不设置时默认为0。 |
| end | number | 否 | 动画插值终点,不设置时默认为1。 |
- animator支持的接口
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| update | options | 过程中可以使用这个接口更新动画参数,入参与createAnimator一致。 |
| play | - | 开始动画。 |
| finish | - | 结束动画。 |
| pause | - | 暂停动画。 |
| cancel | - | 取消动画。 |
| reverse | - | 倒播动画。 |
- animator支持的事件:
| 参数名 | 类型 | 说明 |
| -------- | -------- | -------- |
| frame | number | 逐帧插值回调事件,入参为当前帧的插值 |
| cancel | - | 动画被强制取消 |
| finish | - | 动画播放完成 |
| repeat | - | 动画重新播放 |
- 示例
``` ```
<!-- hml --> <!-- hml -->
<div class="container"> <div class="container">
...@@ -237,3 +77,164 @@ createAnimator(options[...]): void ...@@ -237,3 +77,164 @@ createAnimator(options[...]): void
} }
} }
``` ```
## AnimatorResult
定义Animator结果接口。
### update
update(options: AnimatorOptions): void
更新当前动画器。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项。|
**示例:**
```
animator.update(options);
```
### play
play(): void
启动动画。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.play();
```
### finish
finish(): void
结束动画。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.finish();
```
### pause
pause(): void
暂停动画。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.pause();
```
### cancel
cancel(): void
删除动画。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.cancel();
```
### reverse
reverse(): void
以相反的顺序播放动画。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.reverse();
```
### onframe
onframe: (progress: number) => void
回调时触发。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| progress | number | 是 | 动画的当前进度。|
**示例:**
```
animator.onframe();
```
### onfinish
onfinish: () => void
动画完成。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.onfinish();
```
### oncancel
oncancel: () => void
动画被取消。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.oncancel();
```
### onrepeat
onrepeat: () => void
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
animator.onrepeat();
```
动画将重复。
## AnimatorOptions
定义动画选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 |
| easing | string | 是 | 动画插值曲线,默认为ease'。 |
| delay | number | 是 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 |
| fill | "none" \| "forwards" \| "backwards" \| "both" | 是 | 动画执行后是否恢复到初始状态,默认值为"none"。动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。 |
| direction | "normal" \| "reverse" \| "alternate" \| "alternate-reverse" | 是 | 动画播放模式,默认值"normal"。|
| iterations | number | 是 | 动画播放次数,默认值1。设置为0时不播放,设置为-1时无限次播放。 |
| begin | number | 是 | 动画插值起点,不设置时默认为0。 |
| end | number | 是 | 动画插值终点,不设置时默认为1。 |
# 弹窗
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```
import prompt from '@ohos.prompt'
```
## 权限列表
## prompt.showToast
showToast(options: ShowToastOptions): void
创建并显示文本提示框。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowToastOptions](#ShowToastOptions) | 是 | 文本弹窗选项。 |
**示例:**
```
export default {
showToast() {
prompt.showToast({
message: 'Message Info',
duration: 2000,
});
}
}
```
## ShowToastOptions
文本提示框的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| message | string | 是 | 显示的文本信息。 |
| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;若小于1500ms则取默认值,最大取值为10000ms。 |
| bottom | &lt;length&gt; | 否 | 设置弹窗边框距离屏幕底部的位置。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;仅手机和平板设备支持。 |
## prompt.showDialog
showDialog(options: ShowDialogOptions): Promise&lt;ShowDialogSuccessResponse&gt;
创建并显示对话框,对话框响应后同步返回结果。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowDialogOptions](#ShowDialogOptions) | 是 | 对话框选项。|
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;[ShowDialogSuccessResponse](#ShowDialogSuccessResponse)&gt; | 对话框响应结果。|
**示例:**
```
export default {
showDialog() {
prompt.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
{
text: 'button1',
color: '#000000',
},
{
text: 'button2',
color: '#000000',
}
],
})
.then(data => {
console.info('showDialog success, click button: ' + data.index);
})
.catch(err => {
console.info('showDialog error: ' + err);
})
}
}
```
## prompt.showDialog
showDialog(options: ShowDialogOptions, callback: AsyncCallback&lt;ShowDialogSuccessResponse&gt;):void
创建并显示对话框,对话框响应结果异步返回。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ShowDialogOptions](#ShowDialogOptions) | 是 | 页面显示对话框信息描述。|
| callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#ShowDialogSuccessResponse)&gt; | 是 | 对话框响应结果回调。 |
**示例:**
```
export default {
callback(err, data) {
if(err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
},
showDialog() {
prompt.showDialog({
title: 'showDialog Title Info',
message: 'Message Info',
buttons: [
{
text: 'button1',
color: '#000000',
},
{
text: 'button2',
color: '#000000',
}
]
}, this.callback);
}
}
```
## ShowDialogOptions
对话框的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| title | string | 否 | 标题文本。 |
| message | string | 否 | 内容文本。 |
| buttons | Array | 否 | 对话框中按钮的数组,结构为:{text:'button',&nbsp;color:&nbsp;'\#666666'},支持1-3个按钮。其中第一个为positiveButton;第二个为negativeButton;第三个为neutralButton。 |
## ShowDialogSuccessResponse
对话框的响应结果。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 说明 |
| -------- | -------- | -------- |
| index | number | 选中按钮在buttons数组中的索引。 |
## prompt.showActionMenu
showActionMenu(options: ActionMenuOptions, callback: AsyncCallback&lt;ActionMenuSuccessResponse&gt;):void
创建并显示操作菜单,菜单响应结果异步返回。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ActionMenuOptions](#ActionMenuOptions) | 是 | 操作菜单选项。 |
| callback | AsyncCallback&lt;[ActionMenuSuccessResponse](#ActionMenuSuccessResponse)> | 是 | 菜单响应结果回调。 |
**示例:**
```
export default {
callback(err, data) {
if(err) {
console.info('showActionMenu err: ' + err);
return;
}
console.info('showActionMenu success callback, click button: ' + data.index);
},
showActionMenu() {
prompt.showActionMenu({
title: 'Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
}, this.callback)
}
}
```
## prompt.showActionMenu
showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>
创建并显示操作菜单,菜单响应后同步返回结果。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [ActionMenuOptions](#ActionMenuOptions) | 是 | 操作菜单选项。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;[ActionMenuSuccessResponse](#ActionMenuSuccessResponse)&gt; | 菜单响应结果。|
**示例:**
```
export default {
showActionMenu() {
prompt.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
}
}
```
## ActionMenuOptions
操作菜单的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| title | string | 否 | 标题文本。 |
| buttons | Array | 是 | 菜单中菜单项按钮的数组,结构为:{text:'button',&nbsp;color:&nbsp;'\#666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 |
## ActionMenuSuccessResponse
操作菜单的响应结果。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| index | number | 否 | 选中按钮在buttons数组中的索引,从0开始。 |
# 页面路由
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明**
>
> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> - 页面路由需要在页面渲染完成之后才能调用,在onInit和onReady生命周期中页面还处于渲染阶段,禁止调用页面路由方法。
## 导入模块
```
import router from '@ohos.router'
```
## 权限列表
## router.push
push(options: RouterOptions): void
跳转到应用内的指定页面。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [RouterOptions](#RouterOptions) | 是 | 跳转页面描述信息。 |
**示例:**
```
// 在当前页面中
export default {
pushPage() {
router.push({
url: 'pages/routerpage2/routerpage2',
params: {
data1: 'message',
data2: {
data3: [123, 456, 789]
},
},
});
}
}
```
```
// 在routerpage2页面中
export default {
data: {
data1: 'default',
data2: {
data3: [1, 2, 3]
}
},
onInit() {
console.info('showData1:' + this.data1);
console.info('showData3:' + this.data2.data3);
}
}
```
## router.replace
replace(options: RouterOptions): void
用应用内的某个页面替换当前页面,并销毁被替换的页面。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [RouterOptions](#RouterOptions) | 是 | 替换页面描述信息。 |
**示例:**
```
// 在当前页面中
export default {
replacePage() {
router.replace({
url: 'pages/detail/detail',
params: {
data1: 'message',
},
});
}
}
```
```
// 在detail页面中
export default {
data: {
data1: 'default'
},
onInit() {
console.info('showData1:' + this.data1)
}
}
```
## router.back
back(options?: RouterOptions ): void
返回上一页面或指定的页面。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [RouterOptions](#RouterOptions) | 是 | 返回页面描述信息,其中参数url指路由跳转时会返回到指定url的界面,如果页面栈上没有url页面,则不响应该情况。如果url未设置,则返回上一页。 |
**示例:**
```
// index页面
export default {
indexPushPage() {
router.push({
url: 'pages/detail/detail',
});
}
}
```
```
// detail页面
export default {
detailPushPage() {
router.push({
url: 'pages/mall/mall',
});
}
}
```
```
// mall页面通过back,将返回detail页面
export default {
mallBackPage() {
router.back();
}
}
```
```
// detail页面通过back,将返回index页面
export default {
defaultBack() {
router.back();
}
}
```
```
// 通过back,返回到detail页面
export default {
backToDetail() {
router.back({uri:'pages/detail/detail'});
}
}
```
## router.clear
clear(): void
清空页面栈中的所有历史页面,仅保留当前页面作为栈顶页面。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
export default {
clearPage() {
router.clear();
}
}
```
## router.getLength
getLength(): string
获取当前在页面栈内的页面数量。
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 页面数量,页面栈支持最大数值是32。 |
**示例:**
```
export default {
getLength() {
var size = router.getLength();
console.log('pages stack size = ' + size);
}
}
```
## router.getState
getState(): RouterState
获取当前页面的状态信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**返回值:**
| 类型 | 说明 |
| --------------------------- | -------------- |
| [RouterState](#RouterState) | 页面状态信息。 |
## RouterState
页面状态信息。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。
| 名称 | 类型 | 说明 |
| -------- | -------- | -------- |
| index | number | 表示当前页面在页面栈中的索引。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;从栈底到栈顶,index从1开始递增。 |
| name | string | 表示当前页面的名称,即对应文件名。 |
| path | string | 表示当前页面的路径。 |
**示例:**
```
export default {
getState() {
var page = router.getState();
console.log('current index = ' + page.index);
console.log('current name = ' + page.name);
console.log('current path = ' + page.path);
}
}
```
## router.enableAlertBeforeBackPage
enableAlertBeforeBackPage(options: EnableAlertOptions): void
开启页面返回询问对话框。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| options | [EnableAlertOptions](#EnableAlertOptions) | 是 | 文本弹窗信息描述。 |
**示例:**
```
export default {
enableAlertBeforeBackPage() {
router.enableAlertBeforeBackPage({
message: 'Message Info',
success: function() {
console.log('success');
},
fail: function() {
console.log('fail');
},
});
}
}
```
## EnableAlertOptions
页面返回询问对话框选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| message | string | 是 | 询问对话框内容。 |
## router.disableAlertBeforeBackPage
disableAlertBeforeBackPage(): void
禁用页面返回询问对话框。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**示例:**
```
export default {
disableAlertBeforeBackPage() {
router.disableAlertBeforeBackPage();
}
}
```
## router.getParams
getParams(): Object
获取发起跳转的页面往当前页传入的参数。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**返回值:**
| 类型 | 说明 |
| ------ | ---------------------------------- |
| Object | 发起跳转的页面往当前页传入的参数。 |
**示例:**
- 类Web范示例
```
// 在当前页面中
export default {
pushPage() {
router.push({
url: 'pages/detail/detail',
params: {
data1: 'message',
},
});
}
}
```
```
// 在detail页面中
export default {
onInit() {
console.info('showData1:' + router.getParams().data1);
}
}
```
- 声明式示例
```
//通过router.push跳转至目标页携带params参数
import router from '@ohos.router'
@Entry
@Component
struct Index {
async routePage() {
let options = {
url: 'pages/second',
params: {
text: '这是第一页的值',
data: {
array: [12, 45, 78]
},
}
}
try {
await router.push(options)
} catch (err) {
console.info(` fail callback, code: ${err.code}, msg: ${err.msg}`)
}
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('这是第一页')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({ top: 20 })
.backgroundColor('#ccc')
.onClick(() => {
this.routePage()
})
}
.width('100%')
.height('100%')
}
}
```
```
//在second页面中接收传递过来的参数
import router from '@ohos.router'
@Entry
@Component
struct Second {
private content: string = "这是第二页"
@State text: string = router.getParams().text
@State data: any = router.getParams().data
@State secondData : string = ''
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Text(this.text)
.fontSize(30)
.onClick(()=>{
this.secondData = (this.data.array[1]).toString()
})
.margin({top:20})
Text('第一页传来的数值' + ' ' + this.secondData)
.fontSize(20)
.margin({top:20})
.backgroundColor('red')
}
.width('100%')
.height('100%')
}
}
```
## RouterOptions
路由跳转选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| url | string | 是 | 表示目标页面的uri,可以用以下两种格式:<br/>-&nbsp;页面绝对路径,由配置文件中pages列表提供,例如:<br/>&nbsp;&nbsp;-&nbsp;pages/index/index<br/>&nbsp;&nbsp;-&nbsp;pages/detail/detail<br/>-&nbsp;特殊值,如果uri的值是"/",则跳转到首页。 |
| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 页面路由栈支持的最大Page数量为32。
...@@ -351,7 +351,7 @@ hashMap.forEach((value, key) => { ...@@ -351,7 +351,7 @@ hashMap.forEach((value, key) => {
### entries ### entries
entries(): IterableIterator<[K, V]> entries(): IterableIterator&lt;[K, V]&gt;
返回包含此映射中包含的键值对的新迭代器对象。 返回包含此映射中包含的键值对的新迭代器对象。
...@@ -359,7 +359,7 @@ entries(): IterableIterator<[K, V]> ...@@ -359,7 +359,7 @@ entries(): IterableIterator<[K, V]>
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| IterableIterator<[K, V]> | 返回一个迭代器。 | | IterableIterator&lt;[K, V]&gt; | 返回一个迭代器。 |
**示例:** **示例:**
...@@ -387,7 +387,7 @@ while(temp != undefined) { ...@@ -387,7 +387,7 @@ while(temp != undefined) {
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| IterableIterator<[K, V]> | 返回一个迭代器。 | | IterableIterator&lt;[K, V]&gt; | 返回一个迭代器。 |
**示例:** **示例:**
``` ```
......
...@@ -578,7 +578,7 @@ getLast(): T ...@@ -578,7 +578,7 @@ getLast(): T
**示例:** **示例:**
``` ```
let list = new Vector(); let list = new List();
list.add(2); list.add(2);
list.add(4); list.add(4);
list.add(5); list.add(5);
......
...@@ -416,7 +416,7 @@ plainArray.clear(); ...@@ -416,7 +416,7 @@ plainArray.clear();
### forEach ### forEach
forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray<T>) => void, thisArg?: Object): void forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray&lt;T&gt;) => void, thisArg?: Object): void
通过回调函数来遍历实例对象上的元素以及元素对应的下标。 通过回调函数来遍历实例对象上的元素以及元素对应的下标。
...@@ -432,7 +432,7 @@ callbackfn的参数说明: ...@@ -432,7 +432,7 @@ callbackfn的参数说明:
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| value | T | 是 | 当前遍历到的元素键值对的值。 | | value | T | 是 | 当前遍历到的元素键值对的值。 |
| index | number | 否 | 当前遍历到的元素键值对的键。 | | index | number | 否 | 当前遍历到的元素键值对的键。 |
| plainArray | PlainArray<T> | 否 | 当前调用forEach方法的实例对象。 | | PlainArray | PlainArray&lt;T&gt;| 否 | 当前调用forEach方法的实例对象。 |
**示例:** **示例:**
...@@ -456,7 +456,7 @@ plainArray.forEach((value, key) => { ...@@ -456,7 +456,7 @@ plainArray.forEach((value, key) => {
| 类型 | 说明 | | 类型 | 说明 |
| -------- | -------- | | -------- | -------- |
| IterableIterator<[number, T]> | 返回一个迭代器。 | | IterableIterator&lt;[number, T]&gt; | 返回一个迭代器。 |
**示例:** **示例:**
......
...@@ -16,21 +16,17 @@ import app from '@system.app'; ...@@ -16,21 +16,17 @@ import app from '@system.app';
## app.getInfo ## app.getInfo
getInfo(): &lt;AppResponse&gt; getInfo(): AppResponse
获取当前应用配置文件中声明的信息。 获取当前应用配置文件中声明的信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite **系统能力:** SystemCapability.ArkUI.ArkUI.Lite
**返回值:** **返回值:**
**表1** AppResponse
| 参数名 | 类型 | 说明 | | 参数类型 | 说明 |
| -------- | -------- | -------- | | -------- | -------- |
| appID<sup>6+</sup> | string | 表示应用的包名,用于标识应用的唯一性。 | | [AppResponse](#appresponse) | 定义AppResponse信息。 |
| appName | string | 表示应用的名称。 |
| versionName | string | 表示应用的版本名称。 |
| versionCode | number | 表示应用的版本号。 |
**示例:** **示例:**
...@@ -43,41 +39,6 @@ getInfo(): &lt;AppResponse&gt; ...@@ -43,41 +39,6 @@ getInfo(): &lt;AppResponse&gt;
} }
``` ```
## app.screenOnVisible
screenOnVisible(Object): void
应用申请息屏不返回主表盘,再次亮屏依旧显示应用界面。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| visible | boolean | 否 | 是否启动保活,默认值false。 |
| success | Function | 否 | 接口调用成功的回调函数。 |
| fail | Function | 否 | 接口调用失败的回调函数。 |
| complete | Function | 否 | 接口调用结束的回调函数。 |
**示例:**
```
export default {
screenOnVisible(){
app.screenOnVisible({
visible: true,
success() {
console.log('call app.keepVisible success');
},
fail(data, code) {
console.log('call app.keepVisible fail');
},
});
}
}
```
## app.terminate ## app.terminate
terminate(): void terminate(): void
...@@ -94,10 +55,9 @@ terminate(): void ...@@ -94,10 +55,9 @@ terminate(): void
app.terminate(); app.terminate();
}} }}
``` ```
## app.requestFullWindow ## app.requestFullWindow
requestFullWindow(duration: number): void requestFullWindow(options?: RequestFullWindowOptions): void
请求应用以全窗口运行,FA在某些场景下(如半模态FA)会以非全窗口运行,调用该接口会从非全窗口切换为全窗口运行,如果已经以全窗口运行则该接口调用无效。 请求应用以全窗口运行,FA在某些场景下(如半模态FA)会以非全窗口运行,调用该接口会从非全窗口切换为全窗口运行,如果已经以全窗口运行则该接口调用无效。
...@@ -108,7 +68,7 @@ requestFullWindow(duration: number): void ...@@ -108,7 +68,7 @@ requestFullWindow(duration: number): void
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| duration | number | 否 | 请求全屏时,设定非全屏到全屏的过渡时间,单位为毫秒,默认时间与非全屏到全屏的距离成正比。 | | options | [RequestFullWindowOptions](#requestfullwindowoptions) | 否 | 请求全屏时,设定非全屏到全屏的过渡时间,单位为毫秒,默认时间与非全屏到全屏的距离成正比。 |
**示例:** **示例:**
...@@ -119,4 +79,81 @@ requestFullWindow(duration: number): void ...@@ -119,4 +79,81 @@ requestFullWindow(duration: number): void
duration: 200}); duration: 200});
} }
} }
``` ```
## app.setImageCacheCount
setImageCacheCount(value: number): void
设置解码图像计数的图像缓存容量。如果未设置,应用程序将不会缓存任何解码图像。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | number | 否 | 解码图像计数的值容量。 |
## app.setImageRawDataCacheSize
setImageRawDataCacheSize(value: number): void
在解码前设置原始图像数据大小的图像缓存容量(以字节为单位)。如果未设置,应用程序将不会缓存任何原始图像数据。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | number | 否 | 原始图像数据大小的值容量(以字节为单位)。 |
## app.setImageFileCacheSize
setImageFileCacheSize(value: number): void
在解码前设置磁盘上的图像文件缓存大小(以字节为单位)。如果未设置,应用程序将在磁盘上缓存100MB图像文件。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | number | 否 | 原始图像数据大小的值容量(以字节为单位)。 |
## AppResponse
定义AppResponse信息。
**系统能力:** 以下各项对应的系统能力有所不同,详见下表。
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- |-------- |
| appID<sup>6+</sup> | string | 是 | 表示应用的包名,用于标识应用的唯一性。 <br> **系统能力:** SystemCapability.ArkUI.ArkUI.Full|
| appName | string | 是 | 表示应用的名称。 <br> **系统能力:** SystemCapability.ArkUI.ArkUI.Lite|
| versionName | string | 是 | 表示应用的版本名称。 <br> **系统能力:** SystemCapability.ArkUI.ArkUI.Lite|
| versionCode | number | 是 | 表示应用的版本号。 <br> **系统能力:** SystemCapability.ArkUI.ArkUI.Lite|
## ScreenOnVisibleOptions
定义屏幕上可见接口的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| visible | boolean | 否 | 是否启动保活,默认值false。 |
| success | () => void | 否 | 接口调用成功的回调函数。 |
| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 |
| complete | () => void | 否 | 接口调用结束的回调函数。 |
## RequestFullWindowOptions
定义RequestFullWindow接口的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| duration | number | 是 | 定义动画选项的数量。 |
...@@ -15,7 +15,7 @@ import mediaquery from '@system.mediaquery'; ...@@ -15,7 +15,7 @@ import mediaquery from '@system.mediaquery';
## mediaquery.matchMedia ## mediaquery.matchMedia
matchMedia(condition: string): &lt;MediaQueryList&gt; matchMedia(condition: string): MediaQueryList
根据媒体查询条件,创建MediaQueryList对象。 根据媒体查询条件,创建MediaQueryList对象。
...@@ -28,11 +28,10 @@ matchMedia(condition: string): &lt;MediaQueryList&gt; ...@@ -28,11 +28,10 @@ matchMedia(condition: string): &lt;MediaQueryList&gt;
| condition | string | 是 | 用于查询的条件。 | | condition | string | 是 | 用于查询的条件。 |
**返回值:** **返回值:**
**表1** MediaQueryList
| 参数名 | 类型 | 说明 | | 参数类型 | 说明 |
| -------- | -------- | -------- | | -------- | -------- |
| MediaQueryList | Object | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 | | MediaQueryList | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 |
**示例:** **示例:**
...@@ -44,18 +43,47 @@ export default { ...@@ -44,18 +43,47 @@ export default {
} }
``` ```
**表2** MediaQueryList说明 ## MediaQueryEvent
| 参数名 | 类型 | 说明 | 定义MediaQuery事件。
| -------- | -------- | -------- |
| matches | boolean | 如果查询条件匹配成功则返回true,否则返回值为false。只读。 |
| media | string | 序列化的媒体查询条件,只读。 |
| onchange | Function | matches状态变化时的执行函数。 |
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| matches | boolean | 是 | 匹配结果。 |
## MediaQueryList
定义MediaQuery列表信息。
### 属性
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
## MediaQueryList.addListener | 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| media | string | 否 | 序列化媒体查询条件,该参数为只读。 |
| matches | boolean | 是 | 匹配结果。 |
### onchange
onchange?: (matches: boolean) => void
matches状态变化时的执行函数。
addListener(Object): void **系统能力:** SystemCapability.ArkUI.ArkUI.Full
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| matches | boolean | 是 | matches状态变化时值。 |
### MediaQueryList.addListener
addListener(callback: (event: MediaQueryEvent) => void): void
给MediaQueryList添加回调函数,回调函数应在onShow生命周期之前添加,即需要在onInit或onReady生命周期里添加。 给MediaQueryList添加回调函数,回调函数应在onShow生命周期之前添加,即需要在onInit或onReady生命周期里添加。
...@@ -65,28 +93,18 @@ addListener(Object): void ...@@ -65,28 +93,18 @@ addListener(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | Function | 是 | 匹配条件发生变化的响应函数。 | | callback | (event: MediaQueryEvent) => void | 是 | 匹配条件发生变化的响应函数。 |
**示例:** **示例:**
``` ```
export default { mMediaQueryList.addListener(maxWidthMatch);
onReady() {
var mMediaQueryList = mediaquery.matchMedia('(max-width: 466)');
function maxWidthMatch(e) {
if (e.matches) {
// do something
}
}
mMediaQueryList.addListener(maxWidthMatch);
},
}
``` ```
## MediaQueryList.removeListener ### MediaQueryList.removeListener
removeListener(Object): void removeListener(callback: (event: MediaQueryEvent) => void): void
移除MediaQueryList中的回调函数。 移除MediaQueryList中的回调函数。
...@@ -96,10 +114,14 @@ removeListener(Object): void ...@@ -96,10 +114,14 @@ removeListener(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | Function | 是 | 匹配条件发生变化的响应函数。 | | callback | (event: MediaQueryEvent) => void) | 是 | 匹配条件发生变化的响应函数。 |
**示例:** **示例:**
``` ```
query.removeListener(minWidthMatch); mMediaQueryList.removeListener(maxWidthMatch);
``` ```
\ No newline at end of file
...@@ -13,7 +13,7 @@ import router from '@system.router'; ...@@ -13,7 +13,7 @@ import router from '@system.router';
## router.push ## router.push
push(Object): void push(options: RouterOptions): void
跳转到应用内的指定页面。 跳转到应用内的指定页面。
...@@ -23,8 +23,7 @@ push(Object): void ...@@ -23,8 +23,7 @@ push(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| uri | string | 是 | 表示目标页面的uri,可以用以下两种格式:<br/>-&nbsp;页面绝对路径,由配置文件中pages列表提供,例如:<br/>&nbsp;&nbsp;-&nbsp;pages/index/index<br/>&nbsp;&nbsp;-&nbsp;pages/detail/detail<br/>-&nbsp;特殊值,如果uri的值是"/",则跳转到首页。 | | options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。|
| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
**示例:** **示例:**
...@@ -68,7 +67,7 @@ export default { ...@@ -68,7 +67,7 @@ export default {
## router.replace ## router.replace
replace(Object): void replace(options: RouterOptions): void
用应用内的某个页面替换当前页面,并销毁被替换的页面。 用应用内的某个页面替换当前页面,并销毁被替换的页面。
...@@ -78,8 +77,7 @@ replace(Object): void ...@@ -78,8 +77,7 @@ replace(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:<br/>-&nbsp;页面绝对路径,由配置文件中pages列表提供,例如:<br/>&nbsp;&nbsp;-&nbsp;pages/index/index<br/>&nbsp;&nbsp;-&nbsp;pages/detail/detail<br/>-&nbsp;特殊值,如果uri的值是"/",则跳转到首页。 | | options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。|
| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
**示例:** **示例:**
...@@ -112,7 +110,7 @@ export default { ...@@ -112,7 +110,7 @@ export default {
## router.back ## router.back
back(Object): void back(options?: BackRouterOptions): void
返回上一页面或指定的页面。 返回上一页面或指定的页面。
...@@ -122,8 +120,7 @@ back(Object): void ...@@ -122,8 +120,7 @@ back(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。 | | options | [BackRouterOptions](#backrouteroptions) | 是 | 详细请参考BackRouterOptions。|
| params | Object | 否 | 跳转时要同时传递到目标页面的数据 |
**示例:** **示例:**
...@@ -183,6 +180,20 @@ export default { ...@@ -183,6 +180,20 @@ export default {
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 示例中的uri字段是页面路由,由配置文件中的pages列表指定。 > 示例中的uri字段是页面路由,由配置文件中的pages列表指定。
## router.getParams
getParams(): ParamsInterface
获取当前页面的参数信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [ParamsInterface](#paramsinterface) | 详细请参见ParamsInterface。|
## router.clear ## router.clear
clear(): void clear(): void
...@@ -228,20 +239,17 @@ export default { ...@@ -228,20 +239,17 @@ export default {
## router.getState ## router.getState
getState(): &lt;RouterState&gt; getState(): RouterState
获取当前页面的状态信息。 获取当前页面的状态信息。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full **系统能力:** SystemCapability.ArkUI.ArkUI.Full
**返回值:** **返回值:**
**表1** RouterState
| 参数名 | 类型 | 说明 | | 参数类型 | 说明 |
| -------- | -------- | -------- | | -------- | -------- |
| index | number | 表示当前页面在页面栈中的索引。<br/>>&nbsp;![icon-note.gif](public_sys-resources/icon-note.gif)&nbsp;**说明:**<br/>>&nbsp;从栈底到栈顶,index从1开始递增。 | | [RouterState](#routerstate) | 详细请参见RouterState。|
| name | string | 表示当前页面的名称,即对应文件名。 |
| path | string | 表示当前页面的路径。 |
**示例:** **示例:**
...@@ -258,7 +266,7 @@ export default { ...@@ -258,7 +266,7 @@ export default {
## router.enableAlertBeforeBackPage<sup>6+</sup> ## router.enableAlertBeforeBackPage<sup>6+</sup>
enableAlertBeforeBackPage(Object): void enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void
开启页面返回询问对话框。 开启页面返回询问对话框。
...@@ -268,10 +276,7 @@ enableAlertBeforeBackPage(Object): void ...@@ -268,10 +276,7 @@ enableAlertBeforeBackPage(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| message | string | 是 | 询问对话框内容。 | | options | [EnableAlertBeforeBackPageOptions](#EnableAlertbeforebackpageoptions) | 是 | 详细请参见EnableAlertBeforeBackPageOptions。 |
| success | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用成功的回调函数。 |
| fail | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用失败的回调函数。 |
| complete | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
...@@ -293,7 +298,7 @@ export default { ...@@ -293,7 +298,7 @@ export default {
## router.disableAlertBeforeBackPage<sup>6+</sup> ## router.disableAlertBeforeBackPage<sup>6+</sup>
disableAlertBeforeBackPage(Object): void disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void
禁用页面返回询问对话框。 禁用页面返回询问对话框。
...@@ -303,9 +308,7 @@ disableAlertBeforeBackPage(Object): void ...@@ -303,9 +308,7 @@ disableAlertBeforeBackPage(Object): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| success | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用成功的回调函数。 | | options | [DisableAlertBeforeBackPageOptions](#disablealertbeforebackpageoptions)| 否 | 详细请参见DisableAlertBeforeBackPageOptions。 |
| fail | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用失败的回调函数。 |
| complete | ()&nbsp;=&gt;&nbsp;void | 否 | 接口调用结束的回调函数。 |
**示例:** **示例:**
...@@ -324,3 +327,68 @@ export default { ...@@ -324,3 +327,68 @@ export default {
} }
``` ```
## RouterOptions
定义路由器的选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:<br/>1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:<br/>- pages/index/index<br/> -pages/detail/detail<br/>2. 特定路径。如果URI为斜杠(/),则显示主页。 |
| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 |
## BackRouterOptions
定义路由器返回的选项。
**系统能力:** 以下各项对应的系统能力有所不同,详见下表。
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。 <br>**系统能力:** SystemCapability.ArkUI.ArkUI.Full|
| params | Object | 否 | 跳转时要同时传递到目标页面的数据。 <br>**系统能力:** SystemCapability.ArkUI.ArkUI.Lite|
## RouterState
定义路由器的状态。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- |-------- |
| index | number | 是 | 表示当前页面在页面栈中的索引。从栈底到栈顶,index从1开始递增。 |
| name | string | 是 | 表示当前页面的名称,即对应文件名。 |
| path | string | 是 | 表示当前页面的路径。 |
## EnableAlertBeforeBackPageOptions<sup>6+</sup>
定义EnableAlertBe beforeBackPage选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| message | string | 是 | 询问对话框内容。 |
| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 |
| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 |
| complete | () => void | 否 | 接口调用结束的回调函数。 |
## DisableAlertBeforeBackPageOptions<sup>6+</sup>
定义DisableAlertBeforeBackPage参数选项。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 |
| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。|
| complete | () => void | 否 | 接口调用结束的回调函数。 |
## ParamsInterface
| 名称 | 参数类型 | 说明 |
| -------- | -------- | -------- |
| [key: string] | Object| 路由参数列表。 |
...@@ -195,7 +195,7 @@ let result = treeMap.getLastKey(); ...@@ -195,7 +195,7 @@ let result = treeMap.getLastKey();
setAll(map: TreeMap<K, V>): void setAll(map: TreeMap<K, V>): void
将一个treemap中的所有元素组添加到另一个treeMap中。 将一个TreeMap中的所有元素组添加到另一个TreeMap中。
**参数:** **参数:**
...@@ -218,7 +218,7 @@ treeMap.setAll(map); ...@@ -218,7 +218,7 @@ treeMap.setAll(map);
set(key: K, value: V): Object set(key: K, value: V): Object
treemap中添加一组数据。 容器中添加一组数据。
**参数:** **参数:**
...@@ -330,7 +330,7 @@ let result = treeMap.getHigherKey("sdfs"); ...@@ -330,7 +330,7 @@ let result = treeMap.getHigherKey("sdfs");
replace(key: K, newValue: V): boolean replace(key: K, newValue: V): boolean
TreeMap中一组数据进行更新(替换)。 容器中一组数据进行更新(替换)。
**参数:** **参数:**
...@@ -358,7 +358,7 @@ let result = treeMap.replace("sdfs", 357); ...@@ -358,7 +358,7 @@ let result = treeMap.replace("sdfs", 357);
clear(): void clear(): void
清除TreeMap中的所有元素,并把length置为0。 清除容器中的所有元素,并把length置为0。
**示例:** **示例:**
......
...@@ -139,7 +139,7 @@ let result = treeSet.getLastValue(); ...@@ -139,7 +139,7 @@ let result = treeSet.getLastValue();
add(value: T): boolean add(value: T): boolean
TreeSet中添加一组数据。 容器中添加一组数据。
**参数:** **参数:**
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- [应用开发包结构说明](quick-start/package-structure.md) - [应用开发包结构说明](quick-start/package-structure.md)
- [资源文件的分类](quick-start/basic-resource-file-categories.md) - [资源文件的分类](quick-start/basic-resource-file-categories.md)
- 开发 - 开发
- [Ability开发](ability/Readme-CN.md) - Ability开发
- [Ability框架概述](ability/ability-brief.md) - [Ability框架概述](ability/ability-brief.md)
- FA模型 - FA模型
- [FA模型综述](ability/fa-brief.md) - [FA模型综述](ability/fa-brief.md)
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
- 其他 - 其他
- [WantAgent使用指导](ability/wantagent.md) - [WantAgent使用指导](ability/wantagent.md)
- [Ability助手使用指导](ability/ability-assistant-guidelines.md) - [Ability助手使用指导](ability/ability-assistant-guidelines.md)
- [UI开发](ui/Readme-CN.md) - UI开发
- [方舟开发框架(ArkUI)概述](ui/arkui-overview.md) - [方舟开发框架(ArkUI)概述](ui/arkui-overview.md)
- 基于JS扩展的类Web开发范式 - 基于JS扩展的类Web开发范式
- [概述](ui/ui-js-overview.md) - [概述](ui/ui-js-overview.md)
......
# LIGHT # LIGHT
- [概述](##概述)
- [功能简介](###功能简介)
- [运作机制](###运作机制)
- [开发指导](##开发指导)
- [场景介绍](###场景介绍)
- [接口说明](###接口说明)
- [开发步骤](###开发步骤)
- [调测验证](###调测验证)
## 概述 ## 概述
...@@ -21,7 +9,7 @@ ...@@ -21,7 +9,7 @@
**图 1** Light驱动模型图 **图 1** Light驱动模型图
![Light驱动模型图](figures/Light%E9%A9%B1%E5%8A%A8%E6%A8%A1%E5%9E%8B%E5%9B%BE.png) ![Light驱动模型图](figures/Light驱动模型图.png)
### 运作机制 ### 运作机制
...@@ -29,7 +17,7 @@ ...@@ -29,7 +17,7 @@
**图 2** Light驱动运行图 **图 2** Light驱动运行图
![Light驱动运行图](figures/Light%E9%A9%B1%E5%8A%A8%E8%BF%90%E8%A1%8C%E5%9B%BE.png) ![Light驱动运行图](figures/Light驱动运行图.png)
Light驱动模型以标准系统Hi3516DV300为例,介绍整个驱动加载及运行流程: Light驱动模型以标准系统Hi3516DV300为例,介绍整个驱动加载及运行流程:
......
# PIN<a name="title_PinDevelop"></a> # PIN
- [概述](#section1_PinDevelop)
- [功能简介](#section2_PinDevelop)
- [基本概念](#section3_PinDevelop)
- [运作机制](#section4_PinDevelop)
- [约束与限制](#section5_PinDevelop)
- [使用指导](#section6_PinDevelop)
- [场景介绍](#section7_PinDevelop)
- [接口说明](#section8_PinDevelop)
- [开发步骤](#section9_PinDevelop)
## 概述 <a name="section1_PinDevelop"></a> ## 概述
### 功能简介<a name="section2_PinDevelop"></a> ### 功能简介
PIN即管脚控制器,用于统一管理各SoC厂商管脚资源,对外提供管脚复用功能。 PIN即管脚控制器,用于统一管理各SoC厂商管脚资源,对外提供管脚复用功能。
### 基本概念<a name="section3_PinDevelop"></a> ### 基本概念
PIN是一个软件层面的概念,目的是为了统一各SoC厂商PIN管脚管理,对外提供管脚复用功能,配置PIN管脚的电气特性。 PIN是一个软件层面的概念,目的是为了统一各SoC厂商PIN管脚管理,对外提供管脚复用功能,配置PIN管脚的电气特性。
...@@ -27,26 +18,26 @@ PIN是一个软件层面的概念,目的是为了统一各SoC厂商PIN管脚 ...@@ -27,26 +18,26 @@ PIN是一个软件层面的概念,目的是为了统一各SoC厂商PIN管脚
由于芯片自身的引脚数量有限,无法满足日益增多的外接需求。此时可以通过软件层面的寄存器设置,让引脚工作在不同的状态,从而实现相同引脚完成不同功能的目的。 由于芯片自身的引脚数量有限,无法满足日益增多的外接需求。此时可以通过软件层面的寄存器设置,让引脚工作在不同的状态,从而实现相同引脚完成不同功能的目的。
### 运作机制<a name="section4_PinDevelop"></a> ### 运作机制
在HDF框架中,PIN模块暂不支持用户态,所以不需要发布服务,接口适配模式采用无服务模式(如图1所示),用于不需要在用户态提供API的设备类型,或者没有用户态和内核区分的OS系统,其关联方式是DevHandle直接指向设备对象内核态地址(DevHandle是一个void类型指针)。 在HDF框架中,PIN模块暂不支持用户态,所以不需要发布服务,接口适配模式采用无服务模式(如[图1](#无服务模式结构图)所示),用于不需要在用户态提供API的设备类型,或者没有用户态和内核区分的OS系统,其关联方式是DevHandle直接指向设备对象内核态地址(DevHandle是一个void类型指针)。
PIN模块各分层作用:接口层提供获取PIN管脚、设置PIN管脚推拉方式、获取PIN管脚推拉方式、设置PIN管脚推拉强度、获取PIN管脚推拉强度、设置PIN管脚功能、获取PIN管脚功能、释放PIN管脚的接口。核心层主要提供PIN管脚资源匹配,PIN管脚控制器的添加、移除以及管理的能力,通过钩子函数与适配层交互。适配层主要是将钩子函数的功能实例化,实现具体的功能。 PIN模块各分层作用:接口层提供获取PIN管脚、设置PIN管脚推拉方式、获取PIN管脚推拉方式、设置PIN管脚推拉强度、获取PIN管脚推拉强度、设置PIN管脚功能、获取PIN管脚功能、释放PIN管脚的接口。核心层主要提供PIN管脚资源匹配,PIN管脚控制器的添加、移除以及管理的能力,通过钩子函数与适配层交互。适配层主要是将钩子函数的功能实例化,实现具体的功能。
**图 1** 无服务模式结构图 **图 1** 无服务模式结构图
![image1](figures/无服务模式结构图.png) ![无服务模式结构图](figures/无服务模式结构图.png)
### 约束与限制<a name="section5_PinDevelop"></a> ### 约束与限制
PIN模块目前仅支持轻量和小型系统内核(LiteOS)。 PIN模块目前仅支持轻量和小型系统内核(LiteOS)。
## 开发指导<a name="section6_PinDevelop"></a> ## 开发指导
### 场景介绍<a name="section7_PinDevelop"></a> ### 场景介绍
PIN模块主要用于管脚资源管理。在各SoC厂商对接HDF框架时,需要来适配PIN驱动。 PIN模块主要用于管脚资源管理。在各SoC厂商对接HDF框架时,需要来适配PIN驱动。
### 接口说明<a name="section8_PinDevelop"></a> ### 接口说明
通过以下PinCntlrMethod中的函数调用PIN驱动对应的函数。 通过以下PinCntlrMethod中的函数调用PIN驱动对应的函数。
PinCntlrMethod定义: PinCntlrMethod定义:
...@@ -73,7 +64,7 @@ struct PinCntlrMethod { ...@@ -73,7 +64,7 @@ struct PinCntlrMethod {
| SetPinFunc | **cntlr**:结构体指针,核心层Pin控制器;<br/>**index**:uint32_t变量,管脚索引号;<br/>**funcName**:char指针常量,传入Pin管脚功能; | 无 | HDF_STATUS相关状态 | PIN设置管脚功能 | | SetPinFunc | **cntlr**:结构体指针,核心层Pin控制器;<br/>**index**:uint32_t变量,管脚索引号;<br/>**funcName**:char指针常量,传入Pin管脚功能; | 无 | HDF_STATUS相关状态 | PIN设置管脚功能 |
| GetPinFunc | **cntlr**:结构体指针,核心层Pin控制器;<br/>**index**:uint32_t变量,管脚索引号; | **funcName**:char双重指针常量,传出Pin管脚功能; | HDF_STATUS相关状态 | PIN获取管脚功能 | | GetPinFunc | **cntlr**:结构体指针,核心层Pin控制器;<br/>**index**:uint32_t变量,管脚索引号; | **funcName**:char双重指针常量,传出Pin管脚功能; | HDF_STATUS相关状态 | PIN获取管脚功能 |
### 开发步骤 <a name="section9_PinDevelop"></a> ### 开发步骤
PIN模块适配包含以下四个步骤: PIN模块适配包含以下四个步骤:
...@@ -85,7 +76,7 @@ PIN模块适配包含以下四个步骤: ...@@ -85,7 +76,7 @@ PIN模块适配包含以下四个步骤:
1. **实例化驱动入口:** 1. **实例化驱动入口:**
- 实例化HdfDriverEntry结构体成员。 - 实例化HdfDriverEntry结构体成员。
驱动开发首先需要实例化驱动入口,驱动入口必须为HdfDriverEntry(在 hdf_device_desc.h 中定义)类型的全局变量,且moduleName要和device_info.hcs中保持一致。 驱动开发首先需要实例化驱动入口,驱动入口必须为HdfDriverEntry(在 hdf_device_desc.h 中定义)类型的全局变量,且moduleName要和device_info.hcs中保持一致。
- 调用HDF_INIT将HdfDriverEntry实例化对象注册到HDF框架中。 - 调用HDF_INIT将HdfDriverEntry实例化对象注册到HDF框架中。
一般在加载驱动时HDF会先调用Init函数加载该驱动。当Init调用异常时,HDF框架会调用Release释放驱动资源并退出。 一般在加载驱动时HDF会先调用Init函数加载该驱动。当Init调用异常时,HDF框架会调用Release释放驱动资源并退出。
...@@ -292,7 +283,7 @@ PIN模块适配包含以下四个步骤: ...@@ -292,7 +283,7 @@ PIN模块适配包含以下四个步骤:
HdfDeviceObject这个是整个驱动对外暴露的接口参数,具备HCS配置文件的信息。 HdfDeviceObject这个是整个驱动对外暴露的接口参数,具备HCS配置文件的信息。
返回值: 返回值:
HDF\_STATUS相关状态 (下表为部分展示,如需使用其他状态,可见/drivers/framework/include/utils/hdf\_base.h中HDF\_STATUS 定义)。 HDF\_STATUS相关状态(下表为部分展示,如需使用其他状态,可见/drivers/framework/include/utils/hdf\_base.h中HDF\_STATUS 定义)。
| **状态(值)** | **问题描述** | | **状态(值)** | **问题描述** |
| ---------------------- | -------------- | | ---------------------- | -------------- |
......
...@@ -52,7 +52,7 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar ...@@ -52,7 +52,7 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar
- [标准系统芯片移植指导](standard-system-porting-guide.md) - [标准系统芯片移植指导](standard-system-porting-guide.md)
- [标准系统移植指南](standard-system-porting-guide.md) - [标准系统移植指南](standard-system-porting-guide.md)
- [一种快速移植OpenHarmony Linux内核的方法](porting-linux-kernel.md) - [一种快速移植OpenHarmony Linux内核的方法](porting-linux-kernel.md)
- [轻量和小型系统三方库移植指导]( porting-thirdparty.md) - [轻量和小型系统三方库移植指导](porting-thirdparty.md)
- [概述](porting-thirdparty-overview.md) - [概述](porting-thirdparty-overview.md)
- [CMake方式组织编译的库移植](porting-thirdparty-cmake.md) - [CMake方式组织编译的库移植](porting-thirdparty-cmake.md)
- [Makefile方式组织编译的库移植](porting-thirdparty-makefile.md) - [Makefile方式组织编译的库移植](porting-thirdparty-makefile.md)
......
# 一种快速移植OpenHarmony Linux内核的方法 # 一种快速移植OpenHarmony Linux内核的方法
- [移植概述](#移植概述)
- [移植到三方芯片平台的整体思路](#移植到三方芯片平台的整体思路)
- [内核态层和用户态层](#内核态层和用户态层)
- [获得内核态层的两种方法](#获得内核态层的两种方法)
- [借助已有Linux内核来移植OpenHarmony的流程](#section1233187263176)
- [移植到三方芯片平台的步骤](#移植到三方芯片平台的步骤)
- [整体构建环境的准备](#整体构建环境的准备)
- [内核态基础代码的移植](#内核态基础代码的移植)
- [内核态必选特性HDF的移植](#内核态必选特性hdf的移植)
- [编译Image](#编译image)
- [编译和运行HDF测试用例(可选)](#编译和运行hdf测试用例-可选-)
## 移植概述 ## 移植概述
......
# 使用安装包方式搭建编译环境<a name="ZH-CN_TOPIC_0000001171615528"></a> # 使用安装包方式搭建编译环境<a name="ZH-CN_TOPIC_0000001171615528"></a>
- [安装必要的库和工具](#section108201740181219)
- [安装hb](#section15794154618411)
- [安装LLVM\(仅OpenHarmony\_v1.x分支/标签需要\)](#section711117144296)
使用安装包方式搭建Ubuntu编译环境步骤如下: 使用安装包方式搭建Ubuntu编译环境步骤如下:
......
# hiperf 使用指南 # hiperf 使用指南
- [list 命令](#list-命令)
- [参数说明](#参数说明)
- [使用示例](#使用示例)
- [stat 命令](#stat-命令)
- [参数说明](#参数说明)
- [使用示例](#使用示例)
- [字段说明](#字段说明)
- [record 命令](#record-命令)
- [参数说明](#参数说明)
- [使用示例](#使用示例)
- [report 命令](#report-命令)
- [使用示例](#使用示例)
hiperf是为开发人员提供性能采样分析的工具,基于内核perf机制进行的用户态能力的扩展,可以对指定的程序或者整个系统进行性能采样。 hiperf是为开发人员提供性能采样分析的工具,基于内核perf机制进行的用户态能力的扩展,可以对指定的程序或者整个系统进行性能采样。
......
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
- [DFX](subsystems/subsys-dfx.md) - [DFX](subsystems/subsys-dfx.md)
- 专题 - 专题
- [HPM Part](hpm-part/Readme-CN.md) - HPM Part
- [HPM Part介绍](hpm-part/hpm-part-about.md) - [HPM Part介绍](hpm-part/hpm-part-about.md)
- [HPM Part开发指导](hpm-part/hpm-part-development.md) - [HPM Part开发指导](hpm-part/hpm-part-development.md)
- [HPM Part参考](hpm-part/hpm-part-reference.md) - [HPM Part参考](hpm-part/hpm-part-reference.md)
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
- 参考 - 参考
- [常见问题-设备开发](faqs/Readme-CN.md) - 常见问题-设备开发
- [常见问题概述](faqs/faqs-overview.md) - [常见问题概述](faqs/faqs-overview.md)
- [环境搭建常见问题](faqs/faqs-environment-setup.md) - [环境搭建常见问题](faqs/faqs-environment-setup.md)
- [编译构建子系统常见问题](faqs/faqs-building.md) - [编译构建子系统常见问题](faqs/faqs-building.md)
......
# ChangeLog
**关键的接口/组件变更**
## XXX子系统
### cl.rpc.1 sendRequest返回值类型变更
#### 变更影响
……
#### 关键的接口/组件变更
**模块**
**接口**
**变更后接口**
……
#### 适配指导
……
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# JS API Diff
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本的JS API变更,参见各子系统的详细记录:
- [元能力](js-apidiff-ability.md)
- [程序访问控制](js-apidiff-access-control.md)
- [无障碍](js-apidiff-accessibility.md)
- [帐号](js-apidiff-account.md)
- [ArkUI开发框架](js-apidiff-ace.md)
- [电源服务](js-apidiff-battery.md)
- [包管理](js-apidiff-bundle.md)
- [基础通信](js-apidiff-communicate.md)
- [语言编译器运行时](js-apidiff-complier-and-runtime.md)
- [定制](js-apidiff-config-policy.md)
- [DFX](js-apidiff-dfx.md)
- [分布式数据管理](js-apidiff-distributed-data.md)
- [分布式硬件](js-apidiff-distributed-hardware.md)
- [事件通知](js-apidiff-event-and-notification.md)
- [文件管理](js-apidiff-file-management.md)
- [位置服务](js-apidiff-geolocation.md)
- [全球化](js-apidiff-global.md)
- [图形图像](js-apidiff-graphic.md)
- [Misc软件服务](js-apidiff-misc.md)
- [多模输入](js-apidiff-multi-modal-input.md)
- [OS媒体软件](js-apidiff-multimedia.md)
- [网络管理](js-apidiff-network.md)
- [启动恢复](js-apidiff-recovery.md)
- [资源调度](js-apidiff-resource-scheduler.md)
- [安全基础能力](js-apidiff-security.md)
- [泛Sensor服务](js-apidiff-sensor.md)
- [应用](js-apidiff-settings.md)
- [软总线](js-apidiff-soft-bus.md)
- [电话服务](js-apidiff-telephony.md)
- [升级服务](js-apidiff-update.md)
- [USB服务](js-apidiff-usb.md)
- [用户IAM](js-apidiff-user-authentication.md)
- [窗口管理](js-apidiff-window.md)
# xxx子系统JS API变更
OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下:
## 接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# Native API 差异报告
OpenHarmony 3.1 Release相较于OpenHarmony 3.0 LTS版本的API变更如下:
## 标准系统接口变更
| 模块名称 | 接口名称 | 变更类型 | 变更说明 |
| -------- | -------- | -------- | -------- |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
\ No newline at end of file
# Readme
本目录记录了OpenHarmony 3.1 Release版本相较OpenHarmony 3.0 LTS版本的API变化。
API详细变更记录如下:
- API差异报告
API差异报告记录了API的变更情况,包括新增、变更、废弃、删除。
- [JS API差异报告](js-apidiff-v3.1-release.md)
- [Native API差异报告](native-apidiff-v3.1-release.md)
- [变更说明](changelog-v3.1-release.md)
变更说明重点记录因API变更对开发者调用API的行为产生的影响,并针对变更影响提供适配指导。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册