featureAbility接口切换
FA模型接口 | Stage模型接口对应d.ts文件 | Stage模型对应接口 |
---|---|---|
getWant(callback: AsyncCallback<Want>): void; getWant(): Promise<Want>; | @ohos.app.ability.UIAbility.d.ts | launchWant: Want; |
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;] startAbility(parameter: StartAbilityParameter): Promise<number>; | application\UIAbilityContext.d.ts | startAbility(want: Want, callback: AsyncCallback<void>): void; startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; startAbility(want: Want, options?: StartOptions): Promise<void>; |
getContext(): Context; | @ohos.app.ability.UIAbility.d.ts | context: UIAbilityContext; |
startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void; startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>; | application\UIAbilityContext.d.ts | startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): void; startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback<AbilityResult>): void; startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityResult>; |
terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void; terminateSelfWithResult(parameter: AbilityResult): Promise<void>; | application\UIAbilityContext.d.ts | terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void> terminateSelfWithResult(parameter: AbilityResult): Promise<void>; |
terminateSelf(callback: AsyncCallback<void>): void; terminateSelf(): Promise<void>; | application\UIAbilityContext.d.ts | terminateSelf(callback: AsyncCallback<void>): void; terminateSelf(): Promise<void>; |
acquireDataAbilityHelper(uri: string): DataAbilityHelper; | @ohos.data.dataShare.d.ts @ohos.data.fileAccess.d.ts | createDataShareHelper(context: Context, uri: string, callback: AsyncCallback<DataShareHelper>): void; createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper>; createFileAccessHelper(context: Context): FileAccessHelper; createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper; |
hasWindowFocus(callback: AsyncCallback<boolean>): void; hasWindowFocus(): Promise<boolean>; | @ohos.window.d.ts | on(eventType: ‘windowStageEvent’, callback: Callback<WindowStageEventType>): void; 监听 Active 获焦状态 |
connectAbility(request: Want, options:ConnectOptions ): number; | application\UIAbilityContext.d.ts | connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; |
disconnectAbility(connection: number, callback:AsyncCallback<void>): void; disconnectAbility(connection: number): Promise<void>; | application\UIAbilityContext.d.ts | disconnectAbility(connection: number, callback:AsyncCallback<void>): void; disconnectAbility(connection: number): Promise<void>; |
getWindow(callback: AsyncCallback<window.Window>): void; getWindow(): Promise<window.Window>; | @ohos.window.d.ts | getLastWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void; getLastWindow(ctx: BaseContext): Promise<Window>; |
particleAbility接口切换
FA模型接口 | Stage模型接口对应d.ts文件 | Stage模型对应接口 |
---|---|---|
startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void; startAbility(parameter: StartAbilityParameter): Promise<void>; | application\ServiceExtensionContext.d.ts | startAbility(want: Want, callback: AsyncCallback<void>): void; startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void>): void; startAbility(want: Want, options?: StartOptions): Promise<void>; startServiceExtensionAbility(want: Want, callback: AsyncCallback<void>): void; startServiceExtensionAbility(want: Want): Promise<void>; |
terminateSelf(callback: AsyncCallback<void>): void; terminateSelf(): Promise<void>; | application\ServiceExtensionContext.d.ts | terminateSelf(callback: AsyncCallback<void>): void; terminateSelf(): Promise<void>; |
connectAbility(request: Want, options:ConnectOptions ): number; | application\ServiceExtensionContext.d.ts | connectAbility(want: Want, options: ConnectOptions): number; connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; |
disconnectAbility(connection: number, callback:AsyncCallback<void>): void; disconnectAbility(connection: number): Promise<void>; | application\ServiceExtensionContext.d.ts | disconnectAbility(connection: number, callback:AsyncCallback<void>): void; disconnectAbility(connection: number): Promise<void>; disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback<void>): void; disconnectServiceExtensionAbility(connection: number): Promise<void>; |
acquireDataAbilityHelper(uri: string): DataAbilityHelper; | @ohos.data.dataShare.d.ts @ohos.data.fileAccess.d.ts | createDataShareHelper(context: Context, uri: string, callback: AsyncCallback<DataShareHelper>): void; createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper>; createFileAccessHelper(context: Context): FileAccessHelper; createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper; |
startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback<void>): void; startBackgroundRunning(id: number, request: NotificationRequest): Promise<void>; | @ohos.resourceschedule.backgroundTaskManager.d.ts | startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise<void>; |
cancelBackgroundRunning(callback: AsyncCallback<void>): void; cancelBackgroundRunning(): Promise<void>; | @ohos.resourceschedule.backgroundTaskManager.d.ts | stopBackgroundRunning(context: Context, callback: AsyncCallback): void; stopBackgroundRunning(context: Context): Promise<void>; |
为了能让大家更好的学习鸿蒙(HarmonyOS NEXT)开发技术,这边特意整理了《鸿蒙开发学习手册》(共计890页),希望对大家有所帮助:https://qr21.cn/FV7h05
《鸿蒙开发学习手册》:
如何快速入门:https://qr21.cn/FV7h05
- 基本概念
- 构建第一个ArkTS应用
- ……
开发基础知识:https://qr21.cn/FV7h05
- 应用基础知识
- 配置文件
- 应用数据管理
- 应用安全管理
- 应用隐私保护
- 三方应用调用管控机制
- 资源分类与访问
- 学习ArkTS语言
- ……
基于ArkTS 开发:https://qr21.cn/FV7h05
- Ability开发
- UI开发
- 公共事件与通知
- 窗口管理
- 媒体
- 安全
- 网络与链接
- 电话服务
- 数据管理
- 后台任务(Background Task)管理
- 设备管理
- 设备使用信息统计
- DFX
- 国际化开发
- 折叠屏系列
- ……
鸿蒙开发面试真题(含参考答案):https://qr18.cn/F781PH
鸿蒙开发面试大盘集篇(共计319页):https://qr18.cn/F781PH
1.项目开发必备面试题
2.性能优化方向
3.架构方向
4.鸿蒙开发系统底层方向
5.鸿蒙音视频开发方向
6.鸿蒙车载开发方向
7.鸿蒙南向开发方向