ArkUI
![]() | This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
|
![]() | It has been suggested that ArkGraphics 2D and ArkGraphics 3D be merged into this article. (Discuss) Proposed since May 2024. |
Developer(s) | Huawei |
---|---|
Initial release | October 22, 2021 |
Operating system | HarmonyOS, OpenHarmony, Oniro OS |
Type | Software framework |
License | open source, Apache License[1] |
Website | https://developer.harmonyos.com/en/develop/arkUI |
ArkUI is a declarative based user interface framework for building user interfaces on native HarmonyOS, OpenHarmony alongside Oniro OS applications developed by Huawei for the ArkTS and Cangjie programming language.[2]
Overview
[edit]ArkUI 3.0 is declarative in eTS (extended TypeScript) in HarmonyOS 3.0, followed by main ArkTS programming language in HarmonyOS 3.1, contrasting with the imperative syntax used in Java development in earlier versions of HarmonyOS in HarmonyOS 1.0 and 2.0. ArkUI allows for 2D drawing as well as 3D drawing, animations, event handling, Service Card widgets, and data binding. ArkUI automatically synchronizes between UI views and data.[3]
ArkUI integrates with DevEco Studio IDE to provide for real-time previews during editing, alongside support for debugging and other development features.[4]
ArkJS primarily used for web development paradigm, based on JavaScript that targets smaller and basic applications on ArkUI for web developers on JS and CSS.[5]
History
[edit]During HDC 2021 on October 22, 2021, the HarmonyOS 3.0 developer preview introduced ArkUI 3.0 for eTS, JS programming languages with ArkCompiler. Compared to previous versions of ArkUI 1.0 and 2.0 under imperative development with Java in earlier versions of HarmonyOS.[6]
During HDC 2022 HarmonyOS 3.1 in November 2022, Huawei ArkUI evolved into full declarative development featuring declarative UI capabilities, improved layout ability, component capability improvement and others.[7] In April 2023, HarmonyOS 3.1 Beta 1 build included ArkUI declarative 2D and 3D drawing capabilities. The upgrade also improves layout, component, and app state management capabilities.[8]
During HDC 2023, August 2023, Huawei announced HarmonyOS 4.0 improvements of ArkUI with ArkTS alongside native HarmonyOS NEXT software development using Ark Engine with ArkGraphics 2D and ArkGraphics 3D. Also, the company announced a cross platform extension of ArkUI called ArkUI-X which would allow developers to run applications across Android, iOS and HarmonyOS under one project using DevEco Studio IDE and Visual Studio Code plugins. On January 18, 2024, during HarmonyOS Ecology Conference, Huawei revealed the HarmonyOS NEXT software stack, that included ArkUI/ArkUI-X programming framework with the Ark Compiler/BiSheng Compiler/Ark Runtime compiler & runtime, for both ArkTS and incoming Cangjie programming language.[9]
ArkUI-X
[edit]Developer(s) | Huawei |
---|---|
Initial release | December 8, 2023 |
Operating system | Android, iOS, OpenHarmony, Oniro OS, HarmonyOS, Web platform (ArkJS) |
Type | Application framework |
License | Apache License |
Website | https://developer.harmonyos.com/en/develop/arkUI |
ArkUI-X is an open-source UI software development kit which is the extension of ArkUI created by Huawei. It is used to develop cross platform applications as an application framework from a single codebase for any platform such as Android, iOS, OpenHarmony and native HarmonyOS with HarmonyOS NEXT system, including Web platform with ArkJS which was released on December 8, 2023, after Canary 1 build on August 4, 2023.[10]
ArkUI-X consists of both a UI language and a rendering engine. When a ArkUI-X application is compiled, the key modules used by ArkUI, such as the core engine, graphics engine, and ArkTS runtime, are all cross-platform. The goal is to allow developers to build advanced, high-performance applications on open source OpenHarmony as foundation that can run on different OS platforms while using a single set of master code in reduced development times.[11]
Examples
[edit]The following is an example of a simple Hello World program. It is standard practice in ArkUI to separate the application struct and views into different structs, with the main view named Index
.[12]
import ArkTS
// Index.ets
import router from '@ohos.router';
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
// Add a button to respond to user clicks.
Button() {
Text('Next')
.fontSize(30)
.fontWeight(FontWeight.Bold)
}
.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('40%')
.height('5%')
// Bind the onClick event to the Next button so that clicking the button redirects the user to the second page.
.onClick(() => {
router.pushUrl({ url: 'pages/Second' })
})
}
.width('100%')
}
.height('100%')
}
}
See also
[edit]References
[edit]- ^ "ArkUI API
参考 ". Gitee. OpenAtom OpenHarmony. Retrieved 21 May 2024. - ^ Parker, Victoria. "HDC Technical Sub-forum: A comprehensive look at HarmonyOS 'next-generation UI Framework". Mo4Tech. Retrieved 12 February 2024.
- ^ "2:2 Introduction to the ArkUI framework". arkui.club. © arkui.club. Retrieved 12 February 2024.
- ^ Sarkar, Amy. "HarmonyOS 3.0 ArkUI 3.0: Declarative User Interface framework". HC Newsroom. Retrieved 12 February 2024.
- ^ Kapuściak, Kacper; Wajgelt, Juliusz; Schmidt, Stefan. "Bringing Graphical Applications to Oniro on the Example of React Native". YouTube. Eclipse Foundation. Retrieved 29 February 2024.
- ^ "New release of HarmonyOS 3.0.0 developer preview". SegmentFault. Retrieved 12 February 2024.
- ^ Balogun, Yusuf. "Huawei Enters Declarative Development with HarmonyOS 3.1 Version Announcement". techgenyz. Retrieved 12 February 2024.
- ^ Sarkar, Amy. "HarmonyOS 3.1 Beta 2 rolling out". HC Newsroom. Retrieved 12 February 2024.
- ^ Bhati, Kamlesh. "Huawei HarmonyOS NEXT Official Now: Bring Spatial Design and Vivid Color Concepts". Sparrownews.com. Retrieved 12 February 2024.
- ^ "ArkUI-X Release Notes". ArkUI-X GitHub. Retrieved 12 February 2024.
- ^ "ArkUI-X 预览
版 正式 开源".知 乎专栏 (in Chinese). Retrieved 2024-05-21. - ^ "Getting Started with ArkTS in Stage Model - Implementing Page Redirection". HarmonyOS. Retrieved 12 February 2024.
External links
[edit]- ArkUI at HarmonyOS Developer and Huawei Developer
- ArkUI Example