How Tencent’s ovCompose & KuiklyBase Enable Seamless Cross‑Platform Apps on Android, iOS, and HarmonyOS
This article introduces ovCompose and KuiklyBase, Tencent Video's cross‑platform development framework built on Compose Multiplatform, explains the background, key advantages, implementation details, performance optimizations for Android, iOS and HarmonyOS, provides repository information and outlines future plans.
Background
With the rise of pure HarmonyOS, cross‑platform development has become a critical need. Traditional UI‑only solutions no longer meet business requirements, and developers seek a language that works across Android, iOS and HarmonyOS while preserving native performance. Kotlin and Compose, recommended by Google, offer high performance and flexible native interaction, but lack support for HarmonyOS and iOS mixed‑UI capabilities, which Tencent Video has addressed and now open‑sources.
Feature Advantages
ovCompose has been fully deployed in Tencent Video on HarmonyOS, becoming the first full‑cross‑platform app on the platform. KuiklyBase provides core capabilities such as Kotlin/Native HarmonyOS adaptation, component ecosystem, compilation, stack reconstruction and toolchain improvements, dramatically improving development efficiency across Android, iOS and HarmonyOS.
Implementation Principles
KN HarmonyOS Adaptation – Kotlin 1.9 uses LLVM 11, while Kotlin 2.1 upgrades to LLVM 16. HarmonyOS supports LLVM 12‑15, so KuiklyBase compiles Kotlin IR with Apple’s LLVM 11 and then links with HarmonyOS LLVM 12, avoiding the need for separate Kotlin versions.
Performance Optimizations
Inline optimization: adding always_inline reduced function call overhead after fixing CPU‑feature mismatches.
Thread‑local storage: forcing hardware thread_local on HarmonyOS cut GC‑related stalls by ~30%.
Coroutine handling: reduced exception handling overhead by caching or skipping non‑critical exceptions and disabling libhilog.so interception, stabilizing long‑list scrolling at 120 Hz.
Debugging: optimized Kotlin‑Native debugging scripts to reduce KDS‑LLDB round‑trips, achieving near‑native performance.
iOS Multi‑Modal Rendering
To solve mixed‑UI rendering issues on iOS, a texture‑based XComponent approach draws Compose content into an FBO that participates in ArkUI’s rendering cycle, ensuring perfect synchronization. Additionally, a custom PictureRecorder with incremental hashing reduces diff computation for complex pages.
Repository Description
The open‑source projects are hosted under the GitHub organization Tencent‑TDS and include:
ovCompose‑sample : Demonstrates ovCompose and KuiklyBase features.
ovCompose‑multiplatform‑core : Customized compose‑multiplatform‑core for HarmonyOS.
KuiklyBase‑kotlin : Kotlin‑Multiplatform core with HarmonyOS adaptations and performance tweaks.
KuiklyBase‑components : Cross‑platform components covering resource management, inter‑language calls, networking, animation, etc.
KuiklyBase‑platform : Platform‑specific adaptations and optimizations for HarmonyOS.
Plan
Future work will focus on improving Kotlin‑Native GC behavior, enhancing component modularity, refining the developer experience, and aligning iOS UIKit rendering more closely with Skia. The roadmap also includes expanding support for H5 and mini‑programs.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.