Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
6d3aef2a
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6d3aef2a
编写于
2月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15219 资料描述修改
Merge pull request !15219 from mingxihua/master
上级
4617481f
31cb722e
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
73 addition
and
76 deletion
+73
-76
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
...-dev/reference/apis/js-apis-app-ability-abilityManager.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
...tion-dev/reference/apis/js-apis-app-ability-appManager.md
+13
-13
zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md
...n-dev/reference/apis/js-apis-app-ability-configuration.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-configurationConstant.md
...ference/apis/js-apis-app-ability-configurationConstant.md
+7
-7
zh-cn/application-dev/reference/apis/js-apis-app-ability-environmentCallback.md
...reference/apis/js-apis-app-ability-environmentCallback.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md
...on-dev/reference/apis/js-apis-app-ability-errorManager.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
...-dev/reference/apis/js-apis-app-ability-missionManager.md
+22
-22
zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md
...dev/reference/apis/js-apis-app-ability-quickFixManager.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
...ation-dev/reference/apis/js-apis-app-ability-wantAgent.md
+5
-5
zh-cn/application-dev/reference/apis/js-apis-application-appManager.md
...tion-dev/reference/apis/js-apis-application-appManager.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-application-configuration.md
...n-dev/reference/apis/js-apis-application-configuration.md
+2
-5
zh-cn/application-dev/reference/apis/js-apis-application-environmentCallback.md
...reference/apis/js-apis-application-environmentCallback.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md
...-dev/reference/apis/js-apis-application-missionManager.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-application-windowExtensionAbility.md
...erence/apis/js-apis-application-windowExtensionAbility.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md
...lication-dev/reference/apis/js-apis-inner-ability-want.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md
...erence/apis/js-apis-inner-application-abilityDelegator.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md
...pis/js-apis-inner-application-applicationStateObserver.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
...ference/apis/js-apis-inner-application-missionSnapshot.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-processData.md
...v/reference/apis/js-apis-inner-application-processData.md
+1
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
浏览文件 @
6d3aef2a
...
...
@@ -64,7 +64,7 @@ const config = {
language
:
'
Zh-Hans
'
,
// 简体中文
colorMode
:
COLOR_MODE_LIGHT
,
// 浅色模式
direction
:
DIRECTION_VERTICAL
,
// 垂直方向
screenDensity
:
SCREEN_DENSITY_SDPI
,
// 屏幕
分辨率
为'sdpi'
screenDensity
:
SCREEN_DENSITY_SDPI
,
// 屏幕
像素密度
为'sdpi'
displayId
:
1
,
// 应用在Id为1的物理屏上显示
hasPointerDevice
:
true
,
// 指针类型设备已连接
};
...
...
@@ -76,7 +76,7 @@ try {
}
else
{
console
.
log
(
'
updateConfiguration success.
'
);
}
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}
'
);
}
...
...
@@ -121,7 +121,7 @@ const config = {
language
:
'
Zh-Hans
'
,
// 简体中文
colorMode
:
COLOR_MODE_LIGHT
,
// 浅色模式
direction
:
DIRECTION_VERTICAL
,
// 垂直方向
screenDensity
:
SCREEN_DENSITY_SDPI
,
// 屏幕
分辨率
为'sdpi'
screenDensity
:
SCREEN_DENSITY_SDPI
,
// 屏幕
像素密度
为'sdpi'
displayId
:
1
,
// 应用在Id为1的物理屏上显示
hasPointerDevice
:
true
,
// 指针类型设备已连接
};
...
...
@@ -131,7 +131,7 @@ try {
console
.
log
(
'
updateConfiguration success.
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
updateConfiguration fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}
'
);
}
...
...
@@ -306,7 +306,7 @@ try {
console
.
log
(
'
getExtensionRunningInfos success, data: ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
getExtensionRunningInfos fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error.code: ${JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)}
'
);
}
...
...
@@ -379,5 +379,5 @@ abilityManager.getTopAbility().then((data) => {
console
.
log
(
'
getTopAbility success, data: ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
getTopAbility fail, err: ${JSON.stringify(err)}
'
);
})
})
;
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md
浏览文件 @
6d3aef2a
...
...
@@ -45,7 +45,7 @@ appManager.isRunningInStabilityTest((err, flag) => {
}
else
{
console
.
log
(
'
The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}
'
);
}
})
})
;
```
...
...
@@ -151,7 +151,7 @@ appManager.isRamConstrainedDevice((err, data) => {
}
else
{
console
.
log
(
'
The result of isRamConstrainedDevice is: ${JSON.stringify(data)}
'
);
}
})
})
;
```
## appManager.getAppMemorySize
...
...
@@ -221,7 +221,7 @@ appManager.getAppMemorySize((err, data) => {
}
else
{
console
.
log
(
'
The size of app memory is: ${JSON.stringify(data)}
'
);
}
})
})
;
```
## appManager.getRunningProcessInformation
...
...
@@ -295,7 +295,7 @@ appManager.getRunningProcessInformation((err, data) => {
}
else
{
console
.
log
(
'
The process running information is: ${JSON.stringify(data)}
'
);
}
})
})
;
```
## appManager.on
...
...
@@ -352,7 +352,7 @@ let applicationStateObserver = {
onProcessStateChanged
(
processData
)
{
console
.
log
(
`[appManager] onProcessStateChanged:
${
JSON
.
stringify
(
processData
)}
`
);
}
}
}
;
try
{
const
observerId
=
appManager
.
on
(
'
applicationState
'
,
applicationStateObserver
);
console
.
log
(
`[appManager] observerCode:
${
observerId
}
`
);
...
...
@@ -416,7 +416,7 @@ let applicationStateObserver = {
onProcessStateChanged
(
processData
)
{
console
.
log
(
`[appManager] onProcessStateChanged:
${
JSON
.
stringify
(
processData
)}
`
);
}
}
}
;
let
bundleNameList
=
[
'
bundleName1
'
,
'
bundleName2
'
];
try
{
const
observerId
=
appManager
.
on
(
'
applicationState
'
,
applicationStateObserver
,
bundleNameList
);
...
...
@@ -478,7 +478,7 @@ let applicationStateObserver = {
onProcessStateChanged
(
processData
)
{
console
.
log
(
`[appManager] onProcessStateChanged:
${
JSON
.
stringify
(
processData
)}
`
);
}
}
}
;
let
bundleNameList
=
[
'
bundleName1
'
,
'
bundleName2
'
];
try
{
observerId
=
appManager
.
on
(
'
applicationState
'
,
applicationStateObserver
,
bundleNameList
);
...
...
@@ -559,7 +559,7 @@ let applicationStateObserver = {
onProcessStateChanged
(
processData
)
{
console
.
log
(
`[appManager] onProcessStateChanged:
${
JSON
.
stringify
(
processData
)}
`
);
}
}
}
;
let
bundleNameList
=
[
'
bundleName1
'
,
'
bundleName2
'
];
try
{
observerId
=
appManager
.
on
(
'
applicationState
'
,
applicationStateObserver
,
bundleNameList
);
...
...
@@ -574,7 +574,7 @@ try {
console
.
log
(
'
unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
@@ -660,7 +660,7 @@ appManager.getForegroundApplications().then((data) => {
console
.
log
(
'
getForegroundApplications success, data: ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
getForegroundApplications fail, err: ${JSON.stringify(err)}
'
);
})
})
;
```
## appManager.killProcessWithAccount
...
...
@@ -702,7 +702,7 @@ try {
console
.
log
(
'
killProcessWithAccount success
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
killProcessWithAccount fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
error
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
@@ -844,7 +844,7 @@ try {
console
.
log
(
'
killProcessesByBundleName success.
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
killProcessesByBundleName fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
@@ -940,7 +940,7 @@ try {
console
.
log
(
'
clearUpApplicationData success.
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
clearUpApplicationData fail, err: ${JSON.stringify(err)}
'
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md
浏览文件 @
6d3aef2a
...
...
@@ -13,7 +13,7 @@
| language | string | 是 | 是 | 表示应用程序的当前语言,例如“zh"。 |
| colorMode |
[
ColorMode
](
js-apis-app-ability-configurationConstant.md#configurationconstantcolormode
)
| 是 | 是 | 表示深浅色模式,默认为浅色。取值范围:
<br
/>
- COLOR_MODE_NOT_SET:未设置
<br
/>
- COLOR_MODE_LIGHT:浅色模式
<br
/>
- COLOR_MODE_DARK:深色模式 |
| direction |
[
Direction
](
js-apis-app-ability-configurationConstant.md#configurationconstantdirection
)
| 是 | 否 | 表示屏幕方向,取值范围:
<br
/>
- DIRECTION_NOT_SET:未设置
<br
/>
- DIRECTION_HORIZONTAL:水平方向
<br
/>
- DIRECTION_VERTICAL:垂直方向 |
| screenDensity |
[
ScreenDensity
](
js-apis-app-ability-configurationConstant.md#configurationconstantscreendensity
)
| 是 | 否 | 表示屏幕
分辨率
,取值范围:
<br
/>
- SCREEN_DENSITY_NOT_SET:未设置
<br
/>
- SCREEN_DENSITY_SDPI:120
<br
/>
- SCREEN_DENSITY_MDPI:160
<br
/>
- SCREEN_DENSITY_LDPI:240
<br
/>
- SCREEN_DENSITY_XLDPI:320
<br
/>
- SCREEN_DENSITY_XXLDPI:480
<br
/>
- SCREEN_DENSITY_XXXLDPI:640 |
| screenDensity |
[
ScreenDensity
](
js-apis-app-ability-configurationConstant.md#configurationconstantscreendensity
)
| 是 | 否 | 表示屏幕
像素密度
,取值范围:
<br
/>
- SCREEN_DENSITY_NOT_SET:未设置
<br
/>
- SCREEN_DENSITY_SDPI:120
<br
/>
- SCREEN_DENSITY_MDPI:160
<br
/>
- SCREEN_DENSITY_LDPI:240
<br
/>
- SCREEN_DENSITY_XLDPI:320
<br
/>
- SCREEN_DENSITY_XXLDPI:480
<br
/>
- SCREEN_DENSITY_XXXLDPI:640 |
| displayId | number | 是 | 否 | 表示应用所在的物理屏幕ID。 |
| hasPointerDevice | boolean | 是 | 否 | 指示指针类型设备是否已连接,如键鼠、触控板等。 |
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-configurationConstant.md
浏览文件 @
6d3aef2a
...
...
@@ -46,10 +46,10 @@ import ConfigurationConstant from '@ohos.app.ability.ConfigurationConstant';
| 名称 | 值 | 说明 |
| -------- | -------- | -------- |
| SCREEN_DENSITY_NOT_SET | 0 | 未设置屏幕
分辨率
。 |
| SCREEN_DENSITY_SDPI | 120 | 屏幕
分辨率
为'sdpi'。 |
| SCREEN_DENSITY_MDPI | 160 | 屏幕
分辨率
为'mdpi'。 |
| SCREEN_DENSITY_LDPI | 240 | 屏幕
分辨率
为'ldpi'。 |
| SCREEN_DENSITY_XLDPI | 320 | 屏幕
分辨率
为'xldpi'。 |
| SCREEN_DENSITY_XXLDPI | 480 | 屏幕
分辨率
为'xxldpi'。 |
| SCREEN_DENSITY_XXXLDPI | 640 | 屏幕
分辨率
为'xxxldpi'。 |
| SCREEN_DENSITY_NOT_SET | 0 | 未设置屏幕
像素密度
。 |
| SCREEN_DENSITY_SDPI | 120 | 屏幕
像素密度
为'sdpi'。 |
| SCREEN_DENSITY_MDPI | 160 | 屏幕
像素密度
为'mdpi'。 |
| SCREEN_DENSITY_LDPI | 240 | 屏幕
像素密度
为'ldpi'。 |
| SCREEN_DENSITY_XLDPI | 320 | 屏幕
像素密度
为'xldpi'。 |
| SCREEN_DENSITY_XXLDPI | 480 | 屏幕
像素密度
为'xxldpi'。 |
| SCREEN_DENSITY_XXXLDPI | 640 | 屏幕
像素密度
为'xxxldpi'。 |
zh-cn/application-dev/reference/apis/js-apis-app-ability-environmentCallback.md
浏览文件 @
6d3aef2a
...
...
@@ -63,7 +63,7 @@ export default class MyAbility extends UIAbility {
onMemoryLevel
(
level
){
console
.
log
(
'
onMemoryLevel level: ${JSON.stringify(level)}
'
);
}
}
}
;
// 1.获取applicationContext
let
applicationContext
=
globalThis
.
applicationContext
;
// 2.通过applicationContext注册监听应用内生命周期
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md
浏览文件 @
6d3aef2a
...
...
@@ -39,7 +39,7 @@ let observer = {
onUnhandledException
(
errorMsg
)
{
console
.
log
(
'
onUnhandledException, errorMsg:
'
,
errorMsg
);
}
}
}
;
let
observerId
=
-
1
;
try
{
observerId
=
errorManager
.
on
(
'
error
'
,
observer
);
...
...
@@ -113,7 +113,7 @@ try {
})
.
catch
((
err
)
=>
{
console
.
log
(
'
----------- unregisterErrorObserver fail ----------
'
,
err
);
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
浏览文件 @
6d3aef2a
...
...
@@ -47,13 +47,13 @@ import missionManager from '@ohos.app.ability.missionManager';
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
let
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)}
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)
;
},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)
;
},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)
;
},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)
;
},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)
;
},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)
;
},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)
;
}
};
let
listenerId
=
-
1
;
...
...
@@ -129,13 +129,13 @@ import missionManager from '@ohos.app.ability.missionManager';
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
let
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)}
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)
;
},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)
;
},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)
;
},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)
;
},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)
;
},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)
;
},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)
;
}
};
let
listenerId
=
-
1
;
...
...
@@ -216,13 +216,13 @@ import missionManager from '@ohos.app.ability.missionManager';
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
let
listener
=
{
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)}
onMissionCreated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionCreated-------
'
)
;
},
onMissionDestroyed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionDestroyed-------
'
)
;
},
onMissionSnapshotChanged
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionSnapshotChanged-------
'
)
;
},
onMissionMovedToFront
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionMovedToFront-------
'
)
;
},
onMissionIconUpdated
:
function
(
mission
,
icon
)
{
console
.
log
(
'
--------onMissionIconUpdated-------
'
)
;
},
onMissionClosed
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionClosed-------
'
)
;
},
onMissionLabelUpdated
:
function
(
mission
)
{
console
.
log
(
'
--------onMissionLabelUpdated-------
'
)
;
}
};
let
listenerId
=
-
1
;
...
...
@@ -397,7 +397,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Arr
console
.
log
(
'
size = ${missions.length}
'
);
console
.
log
(
'
missions = ${JSON.stringify(missions)}
'
);
}
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md
浏览文件 @
6d3aef2a
...
...
@@ -116,7 +116,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>;
console
.
info
(
`applyQuickFix err:
${
error
}
`
);
});
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
‘
);
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
```
...
...
@@ -150,7 +150,7 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<Applicat
}
else
{
console
.
info
(
`getApplicationQuickFixInfo success:
${
data
}
`
);
}
})
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
浏览文件 @
6d3aef2a
...
...
@@ -392,7 +392,7 @@ function getWantAgentCallback(err, data) {
console
.
info
(
'
getBundleName ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
})
})
;
}
catch
(
err
){
console
.
info
(
'
getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
}
...
...
@@ -604,7 +604,7 @@ function getWantAgentCallback(err, data) {
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
})
})
;
}
catch
(
err
){
console
.
info
(
'
getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
}
...
...
@@ -818,7 +818,7 @@ function getWantAgentCallback(err, data) {
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
})
})
;
}
catch
(
err
){
console
.
info
(
'
getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
}
...
...
@@ -1029,7 +1029,7 @@ function getWantAgentCallback(err, data) {
console
.
info
(
'
cancel ok!
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
})
})
;
}
catch
(
err
){
console
.
info
(
'
cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
}
...
...
@@ -1561,7 +1561,7 @@ function getWantAgentCallback(err, data) {
console
.
info
(
'
getOperationType ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
})
})
;
}
catch
(
err
){
console
.
info
(
'
getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-application-appManager.md
浏览文件 @
6d3aef2a
...
...
@@ -32,7 +32,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void
appManager
.
isRunningInStabilityTest
((
err
,
flag
)
=>
{
console
.
log
(
'
error: ${JSON.stringify(err)}
'
);
console
.
log
(
'
The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}
'
);
})
})
;
```
...
...
@@ -105,7 +105,7 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
appManager
.
isRamConstrainedDevice
((
err
,
data
)
=>
{
console
.
log
(
'
error: ${JSON.stringify(err)}
'
);
console
.
log
(
'
The result of isRamConstrainedDevice is: ${JSON.stringify(data)}
'
);
})
})
;
```
## appManager.getAppMemorySize
...
...
zh-cn/application-dev/reference/apis/js-apis-application-configuration.md
浏览文件 @
6d3aef2a
...
...
@@ -17,7 +17,6 @@
**示例:**
```
ts
import
hilog
from
'
@ohos.hilog
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
Window
from
'
@ohos.window
'
;
...
...
@@ -42,12 +41,10 @@ export default class EntryAbility extends UIAbility {
windowStage
.
loadContent
(
'
pages/index
'
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
ERROR
);
hilog
.
error
(
0x0000
,
'
testTag
'
,
'
Failed to load the content. Cause: %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
console
.
error
(
'
failed to load the content, error: + ${JSON.stringify(err)}
'
);
return
;
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
Succeeded in loading the content. Data: %{public}s
'
,
JSON
.
stringify
(
data
)
??
''
);
console
.
info
(
'
Succeeded in loading the content, data: + ${JSON.stringify(data)}
'
);
});
}
}
...
...
zh-cn/application-dev/reference/apis/js-apis-application-environmentCallback.md
浏览文件 @
6d3aef2a
...
...
@@ -61,7 +61,7 @@ export default class EntryAbility extends UIAbility {
onMemoryLevel
(
level
){
console
.
log
(
'
onMemoryLevel level: ${level}
'
);
}
}
}
;
// 1.获取applicationContext
let
applicationContext
=
globalThis
.
applicationContext
;
// 2.通过applicationContext注册监听应用内生命周期
...
...
zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md
浏览文件 @
6d3aef2a
...
...
@@ -93,7 +93,7 @@ unregisterMissionListener(listenerId: number, callback: AsyncCallback<void>
missionManager
.
unregisterMissionListener
(
listenerid
,
(
error
)
=>
{
console
.
log
(
'
unregisterMissionListener
'
);
})
})
;
```
...
...
zh-cn/application-dev/reference/apis/js-apis-application-windowExtensionAbility.md
浏览文件 @
6d3aef2a
...
...
@@ -101,9 +101,9 @@ export default class MyWindowExtensionAbility extends WindowExtensionAbility {
window
.
loadContent
(
'
WindowExtAbility/pages/index1
'
).
then
(()
=>
{
window
.
getProperties
().
then
((
pro
)
=>
{
console
.
log
(
'
WindowExtension pro: ${JSON.stringify(pro)}
'
);
})
})
;
window
.
show
();
})
})
;
}
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md
浏览文件 @
6d3aef2a
...
...
@@ -35,7 +35,7 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传
this
.
context
.
startAbility
(
want
,
(
error
)
=>
{
// 显式拉起Ability,通过bundleName、abilityName和moduleName可以唯一确定一个Ability
console
.
log
(
'
error.code = ${error.code}
'
);
})
})
;
```
-
传递FD(文件描述符)数据(在UIAbility对象中调用,其中示例中的context为UIAbility的上下文对象)
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md
浏览文件 @
6d3aef2a
...
...
@@ -231,7 +231,7 @@ function onAbilityCreateCallback(data) {
let
monitor
=
{
abilityName
:
'
abilityname
'
,
onAbilityCreate
:
onAbilityCreateCallback
}
}
;
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
abilityDelegator
.
waitAbilityMonitor
(
monitor
,
timeout
,
(
err
:
any
,
data
:
any
)
=>
{
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md
浏览文件 @
6d3aef2a
...
...
@@ -34,6 +34,6 @@ let applicationStateObserver = {
onProcessStateChanged
(
processData
)
{
console
.
log
(
'
onProcessStateChanged onProcessStateChanged: ${JSON.stringify(processData)}
'
);
}
}
}
;
let
observerCode
=
appManager
.
registerApplicationStateObserver
(
applicationStateObserver
);
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
浏览文件 @
6d3aef2a
...
...
@@ -42,8 +42,8 @@
// 执行正常业务
console
.
log
(
'
bundleName = ${snapshot.ability.bundleName}
'
);
})
})
})
;
})
;
}
catch
(
paramError
)
{
console
.
log
(
'
error: ${paramError.code}, ${paramError.message}
'
);
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-processData.md
浏览文件 @
6d3aef2a
...
...
@@ -39,6 +39,6 @@ let applicationStateObserver = {
console
.
log
(
'
onProcessStateChanged processData.isContinuousTask : ${JSON.stringify(processData.isContinuousTask)}
'
);
console
.
log
(
'
onProcessStateChanged processData.isKeepAlive : ${JSON.stringify(processData.isKeepAlive)}
'
);
}
}
}
;
let
observerCode
=
appManager
.
registerApplicationStateObserver
(
applicationStateObserver
);
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录