diff --git a/en/application-dev/application-models/application-context-stage.md b/en/application-dev/application-models/application-context-stage.md index 8c26d7fbb70a19db0ab07ada99f4df8cc0b290df..c4aec7e780752391a872c1f5d7391b569a2ef8a4 100644 --- a/en/application-dev/application-models/application-context-stage.md +++ b/en/application-dev/application-models/application-context-stage.md @@ -86,13 +86,13 @@ The application file paths obtained by the preceding contexts are different. | Name| Path| | -------- | -------- | - | bundleCodeDir | /el1/bundle/| - | cacheDir | //base/cache/| - | filesDir | //base/files/| - | preferencesDir | //base/preferences/| - | tempDir | //base/temp/| - | databaseDir | //database/| - | distributedFilesDir | /el2/distributedFiles/| + | bundleCodeDir | \/el1/bundle/ | + | cacheDir | \/\/base/cache/ | + | filesDir | \/\/base/files/ | + | preferencesDir | \/\/base/preferences/ | + | tempDir | \/\/base/temp/ | + | databaseDir | \/\/database/ | + | distributedFilesDir | \/el2/distributedFiles/ | The sample code is as follows: @@ -118,13 +118,13 @@ The application file paths obtained by the preceding contexts are different. | Name| Path| | -------- | -------- | - | bundleCodeDir | /el1/bundle/| - | cacheDir | //base/**haps/\**/cache/| - | filesDir | //base/**haps/\**/files/| - | preferencesDir | //base/**haps/\**/preferences/| - | tempDir | //base/**haps/\**/temp/| - | databaseDir | //database/**\**/| - | distributedFilesDir | /el2/distributedFiles/**\**/| + | bundleCodeDir | \/el1/bundle/ | + | cacheDir | \/\/base/**haps/\**/cache/ | + | filesDir | \/\/base/**haps/\**/files/ | + | preferencesDir | \/\/base/**haps/\**/preferences/ | + | tempDir | \/\/base/**haps/\**/temp/ | + | databaseDir | \/\/database/**\**/ | + | distributedFilesDir | \/el2/distributedFiles/**\**/ | The sample code is as follows: diff --git a/en/application-dev/application-models/create-dataability.md b/en/application-dev/application-models/create-dataability.md index f7eceab4da4711b15bd94bb0d61ef99c62521286..9d148a7ba28ffe46484f32b07f7a7660ef49f72d 100644 --- a/en/application-dev/application-models/create-dataability.md +++ b/en/application-dev/application-models/create-dataability.md @@ -12,7 +12,7 @@ import dataAbility from '@ohos.data.dataAbility' import relationalStore from '@ohos.data.relationalStore' const TABLE_NAME = 'book' -const STORE_CONFIG = { name: 'book.db' } +const STORE_CONFIG = { name: 'book.db',securityLevel: 1 } const SQL_CREATE_TABLE = 'CREATE TABLE IF NOT EXISTS book(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, introduction TEXT NOT NULL)' let rdbStore: relationalStore.RdbStore = undefined diff --git a/en/application-dev/reference/apis/js-apis-app-form-formHost.md b/en/application-dev/reference/apis/js-apis-app-form-formHost.md index d81c78c439f21e0ce60ff3df6e33c3d949ee980a..dfa9be0cc2133245a53bcccef8f3899edca4cd1d 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formHost.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formHost.md @@ -1563,7 +1563,7 @@ Unsubscribes from widget uninstall events. This API uses an asynchronous callbac | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------- | | type | string | Yes | Event type. The value **'formUninstall'** indicates a widget uninstall event.| -| callback | Callback<string> | No| Callback used to return the widget ID. If it is left unspecified, it indicates the callback for all the events that have been subscribed.
To cancel the subscription with a given callback, this parameter must be set to the same value as **callback** in **on('formUninstall')**. | +| callback | Callback<string> | No| Callback used to return the widget ID. If it is left unspecified, it indicates the callback for all the events that have been subscribed.
To cancel the subscription with a given callback, this parameter must be set to the same value as **callback** in **on('formUninstall')**.| **Error codes** @@ -1698,8 +1698,8 @@ Unsubscribes from widget removal events. This API uses an asynchronous callback | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------- | | type | string | Yes | Event type. The value **'formRemove'** indicates a widget removal event.| -| callback | Callback<formInfo.RunningFormInfo> | No| Callback used to return **RunningFormInfo**. By default, all the subscriptions to the specified event are canceled.
To cancel the subscription with a given callback, this parameter must be set to the same value as **callback** in **on('formRemove')**. | -| bundleName | string | No| Name of the bundle that functions as the widget host.
To cancel the subscription for a given bundle name, this parameter must be set to the same value as **bundleName** in **on('formRemove')**.
By default, the subscriptions for all the widget hosts are canceled. | +| callback | Callback<formInfo.RunningFormInfo> | No| Callback used to return **RunningFormInfo**. By default, all the subscriptions to the specified event are canceled.
To cancel the subscription with a given callback, this parameter must be set to the same value as **callback** in **on('formRemove')**.| +| bundleName | string | No| Name of the bundle that functions as the widget host.
To cancel the subscription for a given bundle name, this parameter must be set to the same value as **bundleName** in **on('formRemove')**.
By default, the subscriptions for all the widget hosts are canceled.| **Example** @@ -2162,9 +2162,11 @@ import formHost from '@ohos.app.form.formHost'; let formId = '12400633174999288'; try { - formHost.acquireFormData(formId, (error) => { + formHost.acquireFormData(formId, (error, data) => { if (error) { console.error(`error, code: ${error.code}, message: ${error.message}`); + } else { + console.log('formHost acquireFormData, data: ${JSON.stringify(data)}'); } }); } catch(error) { @@ -2192,7 +2194,7 @@ Requests data from the widget provider. This API uses a promise to return the re | Type | Description | | ------------------- | ------------------------- | -| Promise<void> | Promise that returns no value.| +| Promise<{[key: string]: Object}>| Promise used to return the API call result and the shared data.| **Error codes** @@ -2210,8 +2212,8 @@ import formHost from '@ohos.app.form.formHost'; let formId = '12400633174999288'; try { - formHost.acquireFormData(formId).then(() => { - console.log('formHost acquireFormData success'); + formHost.acquireFormData(formId).then((data) => { + console.log('formHost acquireFormData success' + data); }).catch((error) => { console.error(`error, code: ${error.code}, message: ${error.message}`); }); @@ -2286,7 +2288,7 @@ Obtains the information about widget hosts based on the widget provider informat | Name | Type | Mandatory| Description | | ----------- | --------------- | ---- | -------------------------------- | | formProviderFilter | formInfo.FormProviderFilter [formInfo.FormProviderFilter](js-apis-app-form-formInfo.md#formProviderFilter) | Yes | Information about the widget provider.| -| callback | AsyncCallback<Array<[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the result. If the widget host information is obtained, **error** is **undefined** and **data** is the information obtained; otherwise, **data** is an error object.| +| callback | AsyncCallback<Array<[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the result. If the widget host information is obtained, **error** is **undefined** and **data** is the information obtained; otherwise, **error** is an error object.| **Error codes** @@ -2339,7 +2341,7 @@ Obtains the information about widget hosts based on the widget ID. This API uses | Type | Description | | ------------------- | ------------------------- | -| Promise<Array<formInfo.RunningFormInfo[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Promise used to return the widget host information obtained. | +| Promise<Array<formInfo.RunningFormInfo[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Promise used to return the widget host information obtained.| **Error codes** @@ -2379,7 +2381,7 @@ Obtains the information about widget hosts based on the widget ID. This API uses | Name | Type | Mandatory| Description | | ----------- | --------------- | ---- | -------------------------------- | | formId | string | Yes | Widget ID.| -| callback | AsyncCallback<Array<[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the result. If the widget host information is obtained, **error** is **undefined** and **data** is the information obtained; otherwise, **data** is an error object.| +| callback | AsyncCallback<Array<[formInfo.RunningFormInfo](js-apis-app-form-formInfo.md)>> | Yes| Callback used to return the result. If the widget host information is obtained, **error** is **undefined** and **data** is the information obtained; otherwise, **error** is an error object.| **Error codes** diff --git a/en/application-dev/reference/apis/js-apis-wantAgent.md b/en/application-dev/reference/apis/js-apis-wantAgent.md index f30132640cd3a5a5832df9761c2a7e659e9dfa59..0ebee19d694e73ad71e6c3a1f54edfb7108c7378 100644 --- a/en/application-dev/reference/apis/js-apis-wantAgent.md +++ b/en/application-dev/reference/apis/js-apis-wantAgent.md @@ -159,7 +159,7 @@ WantAgent.getWantAgent(wantAgentInfo).then((data) => { getWantAgent(info: WantAgentInfo, callback: AsyncCallback\): void -Obtains a **WantAgent** object. This API uses an asynchronous callback to return the result. If the creation fails, a null **WantAgent** object is returned. +Creates a **WantAgent** object. This API uses an asynchronous callback to return the result. If the creation fails, a null **WantAgent** object is returned. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -167,7 +167,7 @@ Obtains a **WantAgent** object. This API uses an asynchronous callback to return | Name | Type | Mandatory| Description | | -------- | -------------------------- | ---- | ----------------------- | -| info | [WantAgentInfo](js-apis-inner-wantAgent-wantAgentInfo.md) | Yes | Information about the **WantAgent** object to obtain. | +| info | [WantAgentInfo](js-apis-inner-wantAgent-wantAgentInfo.md) | Yes | Information about the **WantAgent** object. | | callback | AsyncCallback\ | Yes | Callback used to return the **WantAgent** object.| **Example** @@ -218,7 +218,7 @@ WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); getWantAgent(info: WantAgentInfo): Promise\ -Obtains a **WantAgent** object. This API uses a promise to return the result. If the creation fails, a null **WantAgent** object is returned. +Creates a **WantAgent** object. This API uses a promise to return the result. If the creation fails, a null **WantAgent** object is returned. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -226,7 +226,7 @@ Obtains a **WantAgent** object. This API uses a promise to return the result. If | Name| Type | Mandatory| Description | | ---- | ------------- | ---- | ------------- | -| info | [WantAgentInfo](js-apis-inner-wantAgent-wantAgentInfo.md) | Yes | Information about the **WantAgent** object to obtain.| +| info | [WantAgentInfo](js-apis-inner-wantAgent-wantAgentInfo.md) | Yes | Information about the **WantAgent** object.| **Return value**