diff --git a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md index 3db5bc33dc4e62a5562fc9a3de4b01c6476c586e..3bc7d33f43bb947212cc25a94f69f02f56e430ec 100644 --- a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @@ -346,6 +346,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -391,6 +392,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | +| 9700004 | Check workInfo failed. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-system-app.md b/en/application-dev/reference/apis/js-apis-system-app.md index b48e4a8f6233b11ffdef0361280dba6322c9f959..2088e0ebed7ad7a21bbeccd79b210cdd537cde15 100644 --- a/en/application-dev/reference/apis/js-apis-system-app.md +++ b/en/application-dev/reference/apis/js-apis-system-app.md @@ -1,6 +1,7 @@ # @system.app (Application Context) > **NOTE** +> > - The APIs of this module are no longer maintained since API version 7. You are advised to use the new APIs. > > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -9,8 +10,8 @@ ## Modules to Import -```ts -import app from '@system.app' +``` +import app from '@system.app'; ``` @@ -20,8 +21,8 @@ getInfo(): AppResponse Obtains the declared information in the **config.json** file of an application. -> **NOTE** -> +> **NOTE** +> > You are advised to use [@ohos.bundle](js-apis-Bundle.md) since API version 7. **System capability**: SystemCapability.ArkUI.ArkUI.Lite @@ -34,13 +35,13 @@ Obtains the declared information in the **config.json** file of an application. **Example** - ```ts -export default { - getInfo() { - let info = app.getInfo() - console.log(JSON.stringify(info)) + ``` + export default { + getInfo(){ + var info = app.getInfo(); + console.log(JSON.stringify(info)); + } } -} ``` ## app.terminate @@ -49,20 +50,19 @@ terminate(): void Terminates the current ability. -> **NOTE** -> +> **NOTE** +> > You are advised to use [@ohos.ability.featureAbility](js-apis-ability-featureAbility.md) since API version 7. **System capability**: SystemCapability.ArkUI.ArkUI.Lite **Example** - ```ts -export default { - terminate() { - app.terminate() - } -} + ``` + export default { + terminate(){ + app.terminate(); + }} ``` ## app.requestFullWindow @@ -70,29 +70,27 @@ requestFullWindow(options?: RequestFullWindowOptions): void Requests the application to run in full window. You can call this API when the FA runs in a non-full window, for example, semi-modal FA. This API is invalid for an application already in full-window mode. -This is a system API and cannot be called by third-party applications. - -> **NOTE** -> +> **NOTE** +> > You are advised to use [@ohos.window](js-apis-window.md) since API version 7. **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | options | [RequestFullWindowOptions](#requestfullwindowoptions) | No| Duration for transition from the non-full window to the full window, in milliseconds. By default, the value is in direct proportion to the distance between the non-full window and the full window.| **Example** - ```ts -export default { - requestFullWindow() { - app.requestFullWindow({ - duration: 200 - }) + ``` + export default { + requestFullWindow(){ + app.requestFullWindow({ + duration: 200}); + } } -} ``` ## app.setImageCacheCount7+ @@ -104,25 +102,26 @@ Sets the maximum number of decoded images that can be cached in the memory to sp **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | number | No| Number of decoded images that are cached in the memory.| +| value | number | Yes| Number of decoded images that are cached in the memory.| **Example** - ```ts -// app.ets -import app from '@system.app' - -export default { - onCreate() { - app.setImageCacheCount(100) // Set the maximum number of decoded images that can be cached in the memory to 100. - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} + ``` + // app.ets + import app from '@system.app'; + + export default { + onCreate() { + app.setImageCacheCount(100) // Set the maximum number of decoded images that can be cached in the memory to 100. + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, + } ``` ## app.setImageRawDataCacheSize7+ @@ -134,26 +133,27 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | number | No| Size of the image data cached before decoding, in bytes.| +| value | number | Yes| Size of the image data cached before decoding, in bytes.| **Example** - ```ts -// app.ets -import app from '@system.app' - -export default { - onCreate() { - app.setImageRawDataCacheSize(104857600) - // Set the upper limit of the memory for caching image data before decoding to 100 MB. (100 x 1024 x 1024 B =104857600 B = 100 MB). - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} + ``` + // app.ets + import app from '@system.app'; + + export default { + onCreate() { + app.setImageRawDataCacheSize(104857600) + // Set the upper limit of the memory for caching image data before decoding to 100 MB. (100 x 1024 x 1024 B =104857600 B = 100 MB). + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, + } ``` ## app.setImageFileCacheSize7+ @@ -165,26 +165,27 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | number | No| Size of the image file cache, in bytes.| +| value | number | Yes| Size of the image file cache, in bytes.| **Example** - ```ts -// app.ets -import app from '@system.app' - -export default { - onCreate() { - app.setImageFileCacheSize(209715200) - // Set the upper limit of the image file cache to 200 MB. (200 x 1024 x 1024 B= 209715200 B = 200 MB). - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} + ``` + // app.ets + import app from '@system.app'; + + export default { + onCreate() { + app.setImageFileCacheSize(209715200) + // Set the upper limit of the image file cache to 200 MB. (200 x 1024 x 1024 B= 209715200 B = 200 MB). + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, + } ``` ## AppResponse @@ -200,6 +201,22 @@ Defines the application response information. | versionName | string | Yes| Application version name.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite| | versionCode | number | Yes| Application version number.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite| +## ScreenOnVisible(deprecated) + +screenOnVisible(options?: ScreenOnVisibleOptions): void + +Defines whether to keep the application visible when the screen is woken up. + +> **NOTE** +> +> This API is deprecated since API Version 8. + +**System capability**: SystemCapability.ArkUI.ArkUI.Full + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- |-------- | +| options | ScreenOnVisibleOptions | No| With keep-alive, the system is prevented from returning to the home screen when the screen is locked, so that the application is visible when the screen is woken up. | + ## ScreenOnVisibleOptions Defines the options of the visible interface on the screen.