未验证 提交 265788fa 编写于 作者: O openharmony_ci 提交者: Gitee

!13485 翻译完成:12250+12668+12492+13000 修改跳转链接为API整改后目标

Merge pull request !13485 from wusongqing/TR12250
......@@ -69,7 +69,7 @@ You can call [fileio.open](../reference/apis/js-apis-fileio.md#fileioopen7) to o
**How to Develop**
1. Call [Context.getFilesDir](../reference/apis/js-apis-Context.md#contextgetfilesdir) to obtain the directory of the application sandbox.
1. Call [Context.getFilesDir](../reference/apis/js-apis-inner-app-context.md#contextgetfilesdir) to obtain the directory of the application sandbox.
2. Call **MediaLibrary.getFileAssets** and **FetchFileResult.getFirstObject** to obtain the first file in the result set of the public directory.
3. Call **fileio.open** to open the file in the sandbox.
4. Call **fileAsset.open** to open the file in the public directory.
......
# Application Context
# @system.app
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **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 +9,8 @@
## Modules to Import
```
import app from '@system.app';
```ts
import app from '@system.app'
```
......@@ -20,7 +20,9 @@ getInfo(): AppResponse
Obtains the declared information in the **config.json** file of an application.
> **Note: ** [`@ohos.bundle`](js-apis-Bundle.md) is recommended from API version 7.
> **NOTE**
>
> You are advised to use [@ohos.bundle](js-apis-Bundle.md) since API version 7.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite
......@@ -32,13 +34,13 @@ Obtains the declared information in the **config.json** file of an application.
**Example**
```
export default {
getInfo(){
var info = app.getInfo();
console.log(JSON.stringify(info));
}
```ts
export default {
getInfo() {
let info = app.getInfo()
console.log(JSON.stringify(info))
}
}
```
## app.terminate
......@@ -47,17 +49,20 @@ terminate(): void
Terminates the current ability.
> **Note: ** [`@ohos.ability.featureAbility`](js-apis-featureAbility.md) is recommended from API version 7.
> **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**
```
export default {
terminate(){
app.terminate();
}}
```ts
export default {
terminate() {
app.terminate()
}
}
```
## app.requestFullWindow
......@@ -67,7 +72,9 @@ Requests the application to run in full window. You can call this API when the F
This is a system API and cannot be called by third-party applications.
> **Note: ** [`@ohos.window`](js-apis-window.md) is recommended from API version 7.
> **NOTE**
>
> You are advised to use [@ohos.window](js-apis-window.md) since API version 7.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
......@@ -78,13 +85,14 @@ This is a system API and cannot be called by third-party applications.
**Example**
```
export default {
requestFullWindow(){
```ts
export default {
requestFullWindow() {
app.requestFullWindow({
duration: 200});
}
duration: 200
})
}
}
```
## app.setImageCacheCount<sup>7+</sup>
......@@ -102,11 +110,11 @@ Sets the maximum number of decoded images that can be cached in the memory to sp
**Example**
```
// app.ets
import app from '@system.app';
```ts
// app.ets
import app from '@system.app'
export default {
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')
......@@ -114,7 +122,7 @@ Sets the maximum number of decoded images that can be cached in the memory to sp
onDestroy() {
console.info('Application onDestroy')
},
}
}
```
## app.setImageRawDataCacheSize<sup>7+</sup>
......@@ -132,11 +140,11 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d
**Example**
```
// app.ets
import app from '@system.app';
```ts
// app.ets
import app from '@system.app'
export default {
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).
......@@ -145,7 +153,7 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d
onDestroy() {
console.info('Application onDestroy')
},
}
}
```
## app.setImageFileCacheSize<sup>7+</sup>
......@@ -163,11 +171,11 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading
**Example**
```
// app.ets
import app from '@system.app';
```ts
// app.ets
import app from '@system.app'
export default {
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).
......@@ -176,7 +184,7 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading
onDestroy() {
console.info('Application onDestroy')
},
}
}
```
## AppResponse
......@@ -213,4 +221,4 @@ Defines the options of the **RequestFullWindow** API.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| duration | number | Yes| Number of animation options.|
| duration | number | Yes| Duration of an animation, in milliseconds.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册