Skip to content
Kuikly in Production: Founder Securities' Cross-Platform Xiaofang App Journey
Mobile Development 27 min read

Kuikly in Production: Founder Securities' Cross-Platform Xiaofang App Journey

Founder Securities adopted Tencent's Kuikly framework for their Xiaofang app, validating it against demanding financial scenarios like real-time charts and AI streaming, then built a multi-module engineering system supporting both dynamic and native delivery, extended with custom SSE networking, cross-platform database, dark mode, and font scaling, progressively rolling out to cash options, stock alerts, AI chat, and conditional orders.

TDS Framework
TDS Framework
TDS Framework

Selection: Multi-Dimensional Validation for a Trusted Foundation

In H1 2025, Founder Securities began evaluating Kuikly ahead of its open-source release. The team ran a structured proof-of-concept against four pillars — cross-platform support (Android, iOS, HarmonyOS), native-grade performance, dynamic update capability, and self-contained controllability — because securities apps demand real-time trading experience, instant hotfixes for money-related bugs, and the ability to debug deep into the framework without vendor dependency.

Validation Scenarios

Six representative Xiaofang screens were rebuilt in Kuikly:

Multi-tab stock detail with sticky headers and embedded WebView — tests complex layout, scroll linkage, and native view mixing.

Interactive daily K-line chart with gestures — high-frequency touch-driven rendering and data updates, the litmus test for market-data scenes.

ETF zone dual-list linkage — verifies coordinated two-list interaction.

Long lists with trading/market data — stresses list performance and incremental update efficiency.

Native/cross-platform/H5 nesting and native component reuse — validates multi-page embedding and native component interop.

Dynamic delivery flow, debugging, and diagnostics — assesses day-to-day developer experience.

Performance Benchmarks

Using a 2,000-item simple/nested list on real Android, iOS, and HarmonyOS devices, the team measured cold-start-to-scroll:

Scroll FPS: 110–120 (near perfect frame rate)

List page memory: stable under 20 MB

CPU increase: ~2%

Native-bundle load time: on par with pure native

Dynamic-bundle load time: slightly slower but no perceptible UX loss

All four pillars met expectations; previous mini-program/H5 pain points (native feel, performance) were resolved or had viable fallbacks. Kuikly was greenlit for production.

Engineering: Integrating Cross-Platform into a Large Brownfield App

1. Host Repo + Kuikly Sub-Repo Model

Adopted "Native host repo + Kuikly sub-repo" . The host repo continues to own the app shell, native infrastructure, and existing features. The Kuikly sub-repo centrally manages the framework, shared components, and cross-platform business code. Boundaries are explicit:

Independent evolution — framework, shared UI, and business modules iterate at their own cadence, coordinated via stable interfaces and versioning.

Low brownfield adoption cost — Kuikly enters as a well-bounded dependency; no massive native refactor. Framework upgrades are validated in the sub-repo before syncing to the host, protecting app stability.

2. Kuikly Multi-Module Architecture

As cross-platform features grew, a single module caused coupling, slow builds, and blocked independent dynamic releases. The team introduced a "main module + physically nested sub-modules" hierarchy:

Common capabilities pushed down to a common module.

Business sub-modules depend on the common library via API, staying decoupled from each other.

The main module aggregates three-platform resources and produces a single compilation entry point.

Gradle command-line flags switch between embedded mode (compile all modules together) and dynamic mode (target sub-module temporarily becomes the entry, excluding others to avoid blank screens). Each platform merges sub-module resources via designated directories; packaging scripts form an automated pipeline. Result: modules develop, evolve, and ship dynamic bundles independently, with standardized onboarding checklists for new modules.

3. Dual Delivery Modes: Dynamic + Native Cross-Platform

The engineering system deliberately supports both delivery shapes from one codebase:

Dynamic mode — for high-frequency, fast-feedback features; bundles pushed OTA.

Native cross-platform mode — for trading paths and core flows where stability, performance, and deep native integration matter; code ships with the app binary.

Both reuse the same business logic, shared components, and platform APIs; build configuration selects the artifact. A two-layer loader — "fetch on page open + pre-fetch at startup per remote config" — makes dynamic updates near-invisible, with fallback to the local native bundle.

4. Kuikly Toolchain

Three standardized commands reduce multi-repo, multi-team, multi-platform friction:

Sync Kuikly — pulls a specified branch/version from the Kuikly sub-repo into the native host project, handling code fetch, dependency updates, and project integration automatically.

Generate Kuikly Dynamic Bundle — builds dynamic artifacts for OTA delivery.

Create Branches & Sync Across Four Repos — one-shot creation of feature branches in the Kuikly sub-repo plus Android, iOS, and HarmonyOS native repos, then syncs Kuikly code, ensuring all platforms start from a unified baseline.

Custom Capability Extensions: Filling Securities-Grade Gaps

1. SSE Streaming Network Layer

Kuikly's built-in HTTP client covers request/response, but Xiaofang AI required server-sent events for token-by-token LLM output. The team built a cross-platform SSE module with a four-stage pipeline:

Protocol parsing in commonMain — native layer only passes raw byte chunks; SSE framing/field parsing lives entirely in Kotlin common code, guaranteeing identical behavior on all three platforms. New platforms only implement "read HTTP stream".

Frame parser handles TCP realities — half-frame buffering, multi-frame coalescing, end-of-stream flush, comment/heartbeat line ignoring.

Reuses the shared native network stack — inherits auth, interceptors, and connection pooling for consistency.

Outcome: a "regular request + streaming request" dual network stack now serves AI chat and other real-time data scenarios.

2. Cross-Platform Database (Three-Layer Design)

Simple key-value storage couldn't handle structured lists, complex state, or encryption mandates. The team wrapped each platform's SQLite implementation behind a unified DAO layer with:

"Control in Kotlin, execute in native" schema declaration — table definitions and migration SQL written once in Kotlin common code; native side is a stateless executor. Adding tables or bumping versions requires zero native changes , eliminating DDL drift.

Reactive query subscriptions (Room-like) — UI calls subscribe(table, selection...); any write to that table automatically triggers re-query and callback. In AIConversationManager, network writes to DB and not a single line of manual UI refresh code exists — the subscription chain drives the view.

Cross-page broadcasts via Kuikly's NotifyModule — instead of a custom event bus, table-change notifications reuse the framework's internal module, solving scope mismatch (per-pager DB module instance vs. global DB singleton) with zero extra infrastructure.

Encryption baked into DAO converters — conversationToValues / rowToConversation encrypt/decrypt transparently; business code sees plain objects, disk stores ciphertext.

Notification noise reduction — bulk inserts/deletes returning 0 rows suppress broadcasts; execSQL parses SELECTs to extract table names for targeted notifications; upsertBatchWithoutNotify silences UI refresh for backfill jobs.

This stack powers offline caches, history, and state recovery with unified specs for schema upgrades, concurrency, crash recovery, and sensitive data protection.

3. Dark Mode Adaptation

Platform-specific theme switches, color token systems, and asset paths made per-screen dark mode brittle. Solution: a KMP ThemeModule bridge + BasePager theme logic. Native modules read the global dark flag, resolve colors via tokens, and set status-bar style. Business code calls getColor, commonAssets, pageAssets only. Colors use "token + night flag" resolved from values / values-night; images use "path inserts dark/" convention. A custom Gradle task auto-generates missing dark assets at build time, preventing runtime fallback inconsistencies. Status-bar styles, gradient tokens, and multi-module dark resource merging are all unified.

4. Five-Level Font Scaling

Regulatory design rules require five discrete font-size tiers with per-region scaling factors on dense pages. The chosen tier is passed as a page launch parameter; Kotlin extension functions declare each Text 's supported tiers; the two combine to compute the final scale factor.

5. Shared UI Component Library

Keyboard — unified layout, input rules, and UX for price/quantity/amount fields across trading flows.

Pull-to-refresh — standardized gesture, loading states, result handling, and error UI; business logic only supplies data.

Other primitives — dialogs, date pickers, toasts, auto-scaling text.

On top, domain-specific components (market data display, trade confirmation, risk warnings) are accumulating into a reusable, consistent cross-platform component system.

Business Rollout: From Pilot to Complex Trading Flows

1. Cash-Secured Put Options (Pilot)

Chosen for low effort and high rollback safety. Covers rule explanation, underlying display, order entry, and result feedback. Validated multi-platform consistency of flow, validation, and state rendering while reusing native account, routing, and trading services via unified modules.

2. Stock Alerts

Real-time quote tracking, multi-dimensional trigger conditions (price, amplitude, turnover, valuation), rule validation, and push notification. Solved a classic dual-list scroll deadlock/bounce with a lightweight UI scroll lock that absorbs layout-lag events. Produced highly reusable input and dialog components.

3. Xiaofang AI (Internal Beta at Publication)

Complex interactions (number scroll, carousel, Lottie/PAG, Canvas K-line flicker) were pre-verified. The novel challenge was streaming: user asks → server streams SSE → Kuikly incrementally parses and updates answer while handling disconnects, retries, loading states, and lifecycle changes. The custom SSE module (see above) cleanly separates network concerns from session/UI state. Xiaofang AI ships via dynamic mode — no app release needed. Kuikly's per-page dynamic bundles each hold isolated global singletons/statics; cross-page sharing, exit caching, and singleton usage route through native persistence or native in-memory caches.

4. Conditional Orders (Brownfield Rewrite)

Many pages, high complexity: market data, condition config, price/qty input, validation, risk warnings, submit confirmation. Heavy use of custom keyboard, unified network, and cross-platform state management. Pushing common capabilities to the base layer let the feature team focus on condition logic and trade flow. Also validated deep interop with native pages (e.g., watchlist). Demonstrates Kuikly's boundary expanding from content/display pages into interaction-heavy trading flows. The team notes that critical trading links still require rigorous test, monitoring, fallback, and rollback mechanisms so velocity doesn't compromise stability.

Summary

Kuikly's adoption in Xiaofang is a continuous cross-platform engineering program, not a one-off framework swap.

Engineering — Native host + Kuikly sub-repo and Kuikly multi-module define clear boundaries between framework, shared UI, and business code; unified toolchain lowers multi-repo/team/platform coordination cost.

Core capabilities — SSE streaming, cross-platform database, dark mode, five-level font scaling, keyboard, pull-to-refresh — built to meet securities-grade demands.

Business validation — Cash options (form flow), Stock alerts (dual-list), Xiaofang AI (streaming + dynamic delivery), Conditional orders (trading rewrite) collectively prove Kuikly across declaration, interaction, streaming, and transaction domains. Xiaofang AI, chaining streaming network, session persistence, and dynamic release, best showcases the stack's completeness.

Official Kuikly team support (timely answers, steady releases) underpinned the rollout. Future work: deepen component system, quality guardrails, and tooling; push more common capabilities down; explore further large-scale scenarios.

About Kuikly

Kuikly is now open source. Repository: https://github.com/Tencent-TDS/KuiklyUI. Documentation: https://kuikly.tds.qq.com/Introduction/arch.html.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mobile developmentcross-platformfintechKotlin Multiplatformdynamic deliveryKuiklySSE streamingreactive database
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.