diff --git a/en/application-dev/reference/apis/js-apis-settings.md b/en/application-dev/reference/apis/js-apis-settings.md index 4fa35b6878ef99f3509af1444e38e89c2ab6f4fd..57dba8b76fd5f56ce5fbe418c541b2d812726af7 100644 --- a/en/application-dev/reference/apis/js-apis-settings.md +++ b/en/application-dev/reference/apis/js-apis-settings.md @@ -608,20 +608,6 @@ Sets the value for a data item. This API uses an asynchronous callback to return | value | object | Yes | Value of the data item. The value range varies by service. | | callback | AsyncCallback\ | Yes | Callback used to return the result. Returns **true** if the operation is successful; returns **false** otherwise. | -**Example** - -```js -import featureAbility from '@ohos.ability.featureAbility'; - -// Update the value of SCREEN_BRIGHTNESS_STATUS. (As this data item exists in the database, the setValue API will update its value.) -let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS); -let helper = featureAbility.acquireDataAbilityHelper(uri); -//@ts-ignore -// The value of the data item is a string. -settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100', (status) => { - console.log('Callback return whether value is set.'); -}); -``` ## settings.setValue(deprecated) @@ -653,21 +639,6 @@ Sets the value for a data item. This API uses a promise to return the result. | ----------------- | -------------------------------------------------- | | Promise\ | Promise used to return the result. Returns **true** if the operation is successful; returns **false** otherwise.| -**Example** - -```js -import featureAbility from '@ohos.ability.featureAbility'; - -// Update the value of SCREEN_BRIGHTNESS_STATUS. (As this data item exists in the database, the setValue API will update its value.) -let uri = settings.getUriSync(settings.display.SCREEN_BRIGHTNESS_STATUS); -let helper = featureAbility.acquireDataAbilityHelper(uri); -//@ts-ignore -// The value of the data item is a string. -settings.setValue(helper, settings.display.SCREEN_BRIGHTNESS_STATUS, '100').then((status) => { - console.log('Callback return whether value is set.'); -}); -``` - ## setting.getValue(deprecated) getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback\): void