代码拉取完成,页面将自动刷新
分布式包管理服务负责管理跨设备的组件调度和任务管理,实现跨设备RPC的能力,可以按需获取跨设备指定语言的资源。
foundation/bundlemanager/distributed_bundle_framework
├── interfaces
│ ├── inner_api # 内部接口存放目录
│ └── kits/js # JS应用接口
│ ├── distributebundlemgr
│ └── distributedBundle
├── services/dbms # dbms服务框架代码
└── services/dbms/test # 测试目录
getRemoteAbilityInfo获取由elementName指定的远程设备上的应用的AbilityInfo信息(callback形式)
参数:
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
elementName | ElementName | 是 | ElementName信息。 |
callback | AsyncCallback<RemoteAbilityInfo> | 是 | 回调函数,调用成功返回err为null,data为RemoteAbilityInfo对象;调用失败err为错误对象, data为undefined。 |
错误码:
以下错误码的详细介绍请参见ohos.bundle错误码。
错误码ID | 错误信息 |
---|---|
17700001 | The specified bundle name is not found. |
17700003 | The specified ability name is not found. |
17700007 | The specified device ID is not found. |
17700027 | The distributed service is not running. |
示例:
try {
distributedBundle.getRemoteAbilityInfo(
{
deviceId: '1',
bundleName: 'com.example.application',
abilityName: 'EntryAbility'
}, (err, data) => {
if (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
} else {
console.info('Operation succeed:' + JSON.stringify(data));
}
});
} catch (err) {
console.log(`Operation failed: error code is ${err.code} and error message is ${err.message}`);
}
指南:
更多开发指导可参考示例文档
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。