HarmonyOS Adaptation: 90% Code Reuse & Custom Flutter Plugins for Poetry App
This case study details how the Chang Xiang Si poetry app overcame HarmonyOS SDK compatibility issues by developing custom Flutter plugins, leveraged HarmonyOS's 'one development, multi-device' capability to achieve 90% code reuse across phones, foldables, and tablets, integrated Huawei Account one-click login, and explores future AI voice reading and eye-tracking interactions.
SDK Compatibility Challenge: Custom Flutter Plugin Development
The primary challenge during HarmonyOS adaptation was that certain SDK plugins could not run directly on HarmonyOS. The Chang Xiang Si team resolved this by using HarmonyOS versions of the SDKs, implementing the required system-layer function calls, and packaging them as Flutter plugins. This approach enabled successful feature integration and system integration. The HarmonyOS technical team provided detailed alternative solutions and development guidance, laying a solid foundation for stable operation. Through close collaboration, the app team achieved autonomous maintenance and continuous iteration of key plugins.
Empowering Development: Open Interfaces and System Share Dialog
Standardized System Interfaces Boost Efficiency
HarmonyOS provides a unified open interface system. For example, the SystemSoundManager module offers a standardized API for ringtone settings. In traditional development, extensive per-device adaptation was required; with HarmonyOS, only a few lines of code are needed to implement complete ringtone functionality, significantly improving development efficiency and allowing the team to focus on core innovation.
System-Level Share Dialog Eliminates Third-Party SDKs
The system share dialog enables one-click sharing to external apps without manual integration of third-party SDKs. It supports text, images, audio, PDF, and other content types, and automatically launches target apps such as WeChat, QQ, and Douyin, greatly reducing development complexity.
Experience Upgrade: Deep Integration of HarmonyOS Innovative Features
1. One Development, Multi-Device Deployment: Reshaping Cross-Device Experience
HarmonyOS's distributed technology breaks single-device boundaries, allowing an app to be called and shared across different hardware for a seamless all-scenario experience. The "one development, multi-device" ("一多") capability lets developers build multi-device apps from a single design. The Chang Xiang Si team followed six main steps:
Determine requirement specifications: Define feature specifications for each device type.
Architecture/feature design: Align multi-device UX design, output code architecture, deployment model, and multi-device UI styles. The team adopted adaptive layouts at the UI level. The Ark Development Framework provides seven adaptive layout capabilities (stretch, uniform, proportion, etc.) that can be used independently or combined. The team primarily used stretch, uniform, and proportion capabilities; for instance, stretch layout required only a few lines of code.
Feature development: Create multi-device app project. In independent mode, develop UIs per device while maximizing shared common capabilities. In unified mode, use UI "一多" capabilities per UX design guides. Chang Xiang Si achieved 90% reuse of both functional and UI code, significantly boosting efficiency.
Testing and debugging: Preview on multiple devices and sizes; obtain multi-device debugging environments; run and debug on each device to catch UX issues early.
Packaging and deployment: Build app packages for different modes, organizing multiple device HAPs into a single app package.
Distribution: The app market splits the package in the cloud and automatically distributes the correct HAP combination per device type.
The team deeply adapted for Huawei foldable and tablet devices, covering both UI-level and feature-level "一多" adaptation, enabling seamless cross-device calling and sharing.
2. One-Click Login: Secure and Convenient Authentication Upgrade
Huawei Account one-click login is built on OAuth 2.0 and OpenID Connect standards. It allows apps to quickly obtain a user's identity identifier and phone number, establishing the app's user system with system-level security authentication that protects privacy and data. Integration steps:
Preparation: Register as a developer on Huawei Developer Alliance, create the app, obtain Client ID, and apply for one-click login permissions.
Development integration: Import Huawei Account Service SDK dependencies; configure parameters (Client ID, authorization scopes); add the one-click login button to the login UI; call Huawei Account Service APIs to implement login logic — sending a request to the Huawei account system, securely retrieving user identity and phone number, and using them to log into Chang Xiang Si.
Testing and release: Test thoroughly across phones, tablets, and network conditions for stability and compatibility; then submit to Huawei AppGallery for release.
This provided users with a fast, convenient, and secure login experience.
Moving Forward with the HarmonyOS Ecosystem
1. Education and HarmonyOS Deep Integration: Co-Creating a Smart Future
On the HarmonyOS technology base, the education sector is achieving deep coupling of "service scenarios" and "system capabilities." Chang Xiang Si exemplifies this: "一多" enables seamless all-scenario experiences across devices; Huawei Account one-click login via HarmonyOS Account Kit enables frictionless authentication, optimizing user experience.
2. Breaking Single Touch Mode: From AI Voice Reading to Eye-Tracking Page Turning
After solidifying the baseline experience, the team began exploring innovative technologies. They are pre-researching AI voice reading to support voice experiences in multiple scenarios. Simultaneously, they are studying AI eye-tracking page turning by invoking relevant engines for gaze-point detection, exploring touchless interaction to free users' hands, improve operation speed and convenience, and enhance immersion. These innovations aim to push user experience beyond traditional boundaries, enabling more natural human-computer interaction. By analyzing usage habits, the app can intelligently determine user state and offer personalized services.
This project not only demonstrates HarmonyOS's technical advantages but also embodies an open, collaborative, co-innovation development philosophy. In today's rapidly evolving mobile app ecosystem, the Chang Xiang Si team's HarmonyOS upgrade serves as a benchmark case of technology-driven experience enhancement, providing valuable practical experience for the education industry.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
HarmonyOS Developer Technology
HarmonyOS developers provide key technology analysis, version updates, Codelabs practice, and event information for HarmonyOS. Welcome developers to join the HarmonyOS ecosystem and create infinite possibilities together!
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.
