2025年4月27日,HarmonyOS 5.0.5 Beta1在此前发布的HarmonyOS 5.0.4 Release的基础上,进一步丰富了ArkUI的组件能力,完善了应用在窗口化场景下的管理能力。
OS平台能力
HarmonyOS 5.0.5 Beta1完整配套信息如下:
软件包 | 发布类型 | 版本号 | Build Version | 发布时间 |
---|---|---|---|---|
系统 | Beta | HarmonyOS 5.0.5 Beta1 | **软件版本:**5.0.0.160 **API版本:**5.0.5(17) | 2025/04/24 |
DevEco Studio | Beta | DevEco Studio 5.0.5 Beta1 | 5.0.13.100 | 2025/04/24 |
SDK | Beta | HarmonyOS 5.0.5 Beta1 SDK | 基于OpenHarmony SDK Ohos_sdk_public 5.0.5.160(API 17 Beat1) | 2025/04/24 |
新增特性
5.0.5 beta1 版本新增增强了以下特性:
Ability
- 新增支持通过startAbility的属性StartOptions来指定创建新窗口的大小(minWindowWidth、minWindowHeight、maxWindowWidth、maxWindowHeight)。
- C API新增支持启动Ability时传递StartOptions。
- C API新增支持获取子进程启动参数。
- C API新增支持设置启动Ability时窗口和dock栏图标的显示模式。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
类新增可选成员 | 类名:global; API声明: 差异内容:NA | 类名:StartOptions; API声明:minWindowWidth?: number; 差异内容:minWindowWidth?: number; | api/@ohos.app.ability.StartOptions.d.ts |
类新增可选成员 | 类名:global; API声明: 差异内容:NA | 类名:StartOptions; API声明:minWindowHeight?: number; 差异内容:minWindowHeight?: number; | api/@ohos.app.ability.StartOptions.d.ts |
类新增可选成员 | 类名:global; API声明: 差异内容:NA | 类名:StartOptions; API声明:maxWindowWidth?: number; 差异内容:maxWindowWidth?: number; | api/@ohos.app.ability.StartOptions.d.ts |
类新增可选成员 | 类名:global; API声明: 差异内容:NA | 类名:StartOptions; API声明:maxWindowHeight?: number; 差异内容:maxWindowHeight?: number; | api/@ohos.app.ability.StartOptions.d.ts |
类新增必选属性或非同名方法 | 类名:global; API声明: 差异内容:NA | 类名:UIAbilityContext; API声明:revokeDelegator(): Promise; 差异内容:revokeDelegator(): Promise; | api/application/UIAbilityContext.d.ts |
ArkData
UDMF新增支持将传入的data转换成多样式数据结构的能力。若原data使用多个record去承载同一份数据的不同样式,则可以使用此接口将原data转换为多样式数据结构。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:relationalStore; API声明:enum Tokenizer 差异内容:enum Tokenizer | api/@ohos.data.relationalStore.d.ts |
新增API | NA | 类名:Tokenizer; API声明:NONE_TOKENIZER = 0 差异内容:NONE_TOKENIZER = 0 | api/@ohos.data.relationalStore.d.ts |
新增API | NA | 类名:Tokenizer; API声明:ICU_TOKENIZER 差异内容:ICU_TOKENIZER | api/@ohos.data.relationalStore.d.ts |
新增API | NA | 类名:unifiedDataChannel; API声明:function convertRecordsToEntries(data: UnifiedData): void; 差异内容:function convertRecordsToEntries(data: UnifiedData): void; | api/@ohos.data.unifiedDataChannel.d.ts |
接口新增可选属性 | 类名:global; API声明: 差异内容:NA | 类名:StoreConfig; API声明:tokenizer?: Tokenizer; 差异内容:tokenizer?: Tokenizer; | api/@ohos.data.relationalStore.d.ts |
AR Engine
新增深度估计,提供三维感知能力,可实现测量、体积估算等。
ArkUI
- 新增鼠标轴事件相关接口。
- NavDestination新增onActive和onInactive生命周期。
- C API的事件能力增强,新增支持获取事件命中的组件的宽度、高度、X坐标、Y坐标等能力。
- 基础类型定义新增支持清除当前的预上屏文本内容。
- UIContext新增支持创建不依赖窗口的UI实例。
- 组件可见区域变化事件新增支持设置事件的回调参数,限制它的执行间隔。
- ImageAnimator组件支持设置是否通过系统onVisibleAreaChange的可见性来判断组件的暂停和播放。
- 画中画窗口支持通过创建参数LocalStorage实现页面级别的UI状态存储单元,多实例下可用来跟踪主窗实例。
- 针对PC/2in1设备的窗口管理新增支持主窗的尺寸记忆功能。
- 针对PC/2in1设备和平板设备的窗口管理新增支持设置子窗或悬浮窗窗口边缘阴影的模糊半径。
- 针对PC/2in1设备和平板设备的窗口管理新增支持设置子窗口在其父窗口处于拖拽移动或拖拽缩放过程时,该子窗口是否支持跨多个屏幕同时显示。
Audio Kit
新增支持Float32音频流采样格式。
AVCodec Kit
视频解码新增支持MPEG2、MPEG4、H.263的软件解码。
AVSession Kit
新增支持单句/单条歌词展示的属性singleLyricText。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
接口新增可选属性 | 类名:global; API声明: 差异内容:NA | 类名:AVMetadata; API声明:singleLyricText?: string; 差异内容:singleLyricText?: string; | api/@ohos.multimedia.avsession.d.ts |
Background Tasks Kit
新增后台子进程管理模块,提供应用对子进程进行压制、解压制的能力,避免子进程过多占用系统资源,导致系统使用卡顿。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:global; API声明:declare namespace backgroundProcessManager 差异内容:declare namespace backgroundProcessManager | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增API | NA | 类名:backgroundProcessManager; API声明:export enum ProcessPriority 差异内容:export enum ProcessPriority | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增API | NA | 类名:ProcessPriority; API声明:PROCESS_BACKGROUND = 1 差异内容:PROCESS_BACKGROUND = 1 | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增API | NA | 类名:ProcessPriority; API声明:PROCESS_INACTIVE = 2 差异内容:PROCESS_INACTIVE = 2 | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增API | NA | 类名:backgroundProcessManager; API声明:function setProcessPriority(pid: number, priority: ProcessPriority): Promise; 差异内容:function setProcessPriority(pid: number, priority: ProcessPriority): Promise; | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增API | NA | 类名:backgroundProcessManager; API声明:function resetProcessPriority(pid: number): Promise; 差异内容:function resetProcessPriority(pid: number): Promise; | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
新增kit | 类名:global; API声明: 差异内容:NA | 类名:global; API声明: api@ohos.resourceschedule.backgroundProcessManager.d.ts 差异内容:BackgroundTasksKit | api/@ohos.resourceschedule.backgroundProcessManager.d.ts |
Connectivity Kit
蓝牙socket模块新增支持通过clientSocket获取对端设备地址的能力。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:socket; API声明:function getDeviceId(clientSocket: number): string; 差异内容:function getDeviceId(clientSocket: number): string; | api/@ohos.bluetooth.socket.d.ts |
删除API | 类名:opp; API声明:function createOppServerProfile(): OppServerProfile; 差异内容:function createOppServerProfile(): OppServerProfile; | NA | api/@ohos.bluetooth.opp.d.ts |
起始版本有变化 | 类名:global; API声明:declare namespace opp 差异内容:15 | 类名:global; API声明:declare namespace opp 差异内容:16 | api/@ohos.bluetooth.opp.d.ts |
起始版本有变化 | 类名:opp; API声明:interface OppServerProfile 差异内容:15 | 类名:opp; API声明:interface OppServerProfile 差异内容:16 | api/@ohos.bluetooth.opp.d.ts |
File Manager Service Kit
【新增Kit】File Manager Service Kit(文件管理服务)为开发者提供文件管理相关能力,开发者通过File Manager Service Kit完成文件删除到回收站、获取文件图标等功能,满足用户对文件管理的多样性诉求。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:global; API声明:declare namespace fileManagerService 差异内容:declare namespace fileManagerService | api/@hms.filemanagement.fileManagerService.d.ts |
新增API | NA | 类名:fileManagerService; API声明:function deleteToTrash(uri: string): Promise; 差异内容:function deleteToTrash(uri: string): Promise; | api/@hms.filemanagement.fileManagerService.d.ts |
新增API | NA | 类名:fileManagerService; API声明:function getFileIconSync(fileType: string): string | Resource; 差异内容:function getFileIconSync(fileType: string): string | Resource; | api/@hms.filemanagement.fileManagerService.d.ts |
新增API | NA | 类名:fileManagerService; API声明:function getFileIcon(fileType: string): Promise<string | Resource>; 差异内容:function getFileIcon(fileType: string): Promise<string | Resource>; | api/@hms.filemanagement.fileManagerService.d.ts |
新增kit | 类名:global; API声明: 差异内容:NA | 类名:global; API声明: api@hms.filemanagement.fileManagerService.d.ts 差异内容:FileManagerServiceKit | api/@hms.filemanagement.fileManagerService.d.ts |
新增kit | 类名:global; API声明: 差异内容:NA | 类名:global; API声明: kits@kit.FileManagerServiceKit.d.ts 差异内容:FileManagerServiceKit | kits/@kit.FileManagerServiceKit.d.ts |
IME Kit
输入法框架新增支持设置显示预览文本时的回调,支持订阅输入法应用操作文本预览内容的事件。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:inputMethod; API声明:export type SetPreviewTextCallback = (text: string, range: Range) => void; 差异内容:export type SetPreviewTextCallback = (text: string, range: Range) => void; | api/@ohos.inputMethod.d.ts |
接口新增可选或必选方法 | 类名:global; API声明: 差异内容:NA | 类名:InputMethodController; API声明:on(type: ‘setPreviewText’, callback: SetPreviewTextCallback): void; 差异内容:on(type: ‘setPreviewText’, callback: SetPreviewTextCallback): void; | api/@ohos.inputMethod.d.ts |
接口新增可选或必选方法 | 类名:global; API声明: 差异内容:NA | 类名:InputMethodController; API声明:off(type: ‘setPreviewText’, callback?: SetPreviewTextCallback): void; 差异内容:off(type: ‘setPreviewText’, callback?: SetPreviewTextCallback): void; | api/@ohos.inputMethod.d.ts |
接口新增可选或必选方法 | 类名:global; API声明: 差异内容:NA | 类名:InputMethodController; API声明:on(type: ‘finishTextPreview’, callback: Callback): void; 差异内容:on(type: ‘finishTextPreview’, callback: Callback): void; | api/@ohos.inputMethod.d.ts |
接口新增可选或必选方法 | 类名:global; API声明: 差异内容:NA | 类名:InputMethodController; API声明:off(type: ‘finishTextPreview’, callback?: Callback): void; 差异内容:off(type: ‘finishTextPreview’, callback?: Callback): void; | api/@ohos.inputMethod.d.ts |
Media Kit
调用媒体播放器AVPlayer设置播放策略时,新增支持Prepare之后显示视频起播首帧(showFirstFrameOnPrepare)。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
接口新增可选属性 | 类名:global; API声明: 差异内容:NA | 类名:PlaybackStrategy; API声明:showFirstFrameOnPrepare?: boolean; 差异内容:showFirstFrameOnPrepare?: boolean; | api/@ohos.multimedia.media.d.ts |
Payment Kit
新增引导用户绑卡能力。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:paymentService; API声明:interface BindCardResult 差异内容:interface BindCardResult | api/@hms.core.payment.paymentService.d.ts |
新增API | NA | 类名:BindCardResult; API声明:hasBankCard: boolean; 差异内容:hasBankCard: boolean; | api/@hms.core.payment.paymentService.d.ts |
新增API | NA | 类名:BindCardResult; API声明:hasJustBoundCard?: boolean; 差异内容:hasJustBoundCard?: boolean; | api/@hms.core.payment.paymentService.d.ts |
新增API | NA | 类名:paymentService; API声明:function requestBindCard(context: common.UIAbilityContext | common.UIExtensionContext): Promise; 差异内容:function requestBindCard(context: common.UIAbilityContext | common.UIExtensionContext): Promise; | api/@hms.core.payment.paymentService.d.ts |
PDF Kit
新增支持对PDF文档进行加密。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
类新增必选属性或非同名方法 | 类名:global; API声明: 差异内容:NA | 类名:PdfDocument; API声明:setPdfPassword(password: string): boolean; 差异内容:setPdfPassword(password: string): boolean; | api/@hms.officeservice.pdfservice.d.ts |
Preview Kit
新增文件打开加速预加载状态感知能力。
操作 | 旧版本 | 新版本 | d.ts文件 |
---|---|---|---|
新增API | NA | 类名:global; API声明:declare namespace openFileBoost 差异内容:declare namespace openFileBoost | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:export enum FilePreloadState 差异内容:export enum FilePreloadState | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadState; API声明:NOT_PRELOADED = 0 差异内容:NOT_PRELOADED = 0 | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadState; API声明:PRELOADING = 1 差异内容:PRELOADING = 1 | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadState; API声明:PRELOADED = 2 差异内容:PRELOADED = 2 | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:export interface FilePreloadStatusInfo 差异内容:export interface FilePreloadStatusInfo | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadStatusInfo; API声明:sandboxPath: string; 差异内容:sandboxPath: string; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadStatusInfo; API声明:progress: number; 差异内容:progress: number; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:FilePreloadStatusInfo; API声明:state: FilePreloadState; 差异内容:state: FilePreloadState; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:function on(type: ‘filePreloadStateChanged’, callback: Callback): void; 差异内容:function on(type: ‘filePreloadStateChanged’, callback: Callback): void; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:function off(type: ‘filePreloadStateChanged’, callback?: Callback): void; 差异内容:function off(type: ‘filePreloadStateChanged’, callback?: Callback): void; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:function addFile(file: string): void; 差异内容:function addFile(file: string): void; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:function removeFile(file: string): void; 差异内容:function removeFile(file: string): void; | api/@hms.pcService.openFileBoost.d.ts |
新增API | NA | 类名:openFileBoost; API声明:function queryFilePreloadStatusInfo(file: string): FilePreloadStatusInfo; 差异内容:function queryFilePreloadStatusInfo(file: string): FilePreloadStatusInfo; | api/@hms.pcService.openFileBoost.d.ts |
新增kit | 类名:global; API声明: 差异内容:NA | 类名:global; API声明:api@hms.pcService.openFileBoost.d.ts 差异内容:PreviewKit | api/@hms.pcService.openFileBoost.d.ts |
Vision Kit
文档扫描结果回调接口增加状态码,用于判断输入图片uris是否全部无效。
配置文件
配置文件module.json5新增Hook配置:通过abilitySrcEntryDelegator可标识当前Module需要Hook的UIAbility的名称,通过abilityStageSrcEntryDelegator可标识当前Module需要Hook的AbilityStage(其值配置为对应Module的名称),两者组合使用,共同指定Hook的目标对象。
DevEco Studio
DevEco Studio 5.0.13.100携带的工具列表、支持的API范围及开发态版本号信息如下:
组件 | 版本 | 说明 |
---|---|---|
DevEco Studio | DevEco Studio 5.0.5 Beta1(5.0.13.100) | - |
HarmonyOS SDK | HarmonyOS 5.0.5 Beta1 SDK | - |
HarmonyOS Emulator | HarmonyOS Emulator 5.0.5 Beta1(5.0.9.380) | 模拟器,当前支持手机(包括折叠屏)、平板。 |
Hvigor | 5.17.0 | 编译构建工具DevEco Hvigor(以下简称Hvigor),适用于API 10及以上的工程。 |
ohpm | 5.0.16 | OpenHarmony三方库的包管理工具。 |
compatibleSdk | 最低兼容版本:4.0.0(10) | HarmonyOS应用/元服务兼容的最低SDK版本。 |
modelVersion | 5.0.5 | 开发态版本号。 |
Beta1(5.0.13.100)新增和增强特性:
- DevEco Studio支持开发API 17工程。
- hvigor-config.json5文件的properties下新增ohos.uiTransform.Optimization字段,用于指定是否对ArkTS编译转换后的产物中的bundleName字段开启优化,开启后,bundleName字段的值是变量。