HarmonyAtomicService
HarmonyOS NEXT 开发的元服务示例。包含:静态库/动态库+多模块设计、状态管理+统一路由、云函数(云数据库)、网络请求、自定义组件、动态路由、消息通知、等工具库的封装设计。
HarmonyAtomicService: HarmonyOS NEXT example code
A HarmonyOS NEXT meta service example that covers static and dynamic libraries, state management, routing, cloud functions, cloud database, and the Huawei account service.
What the example covers
The repository is a HarmonyOS NEXT meta service example, and its README lists the design topics covered. That includes static libraries and dynamic packages with multi-module design, state management, and unified routing management with router and navPathStack. Network requests come with Loading, Toast, and data persistence tool libraries. There are also custom components, EventBus notifications, modifiers that implement throttling, debouncing, and permission requests, dynamic routing, cloud function and cloud database examples, and a Huawei account service example.
Module tables
Module tables lay out where everything lives. A fast util module holds tool classes: FastLog for logging, EventBus for message notification, FastRouter for route management, FastNavRouter for dynamic routing, ThrottleTool for throttling and debouncing, FastPermission for permission requests, and PreferencesUtil for data persistence. A fast ui module provides UI wrappers, styles, and toast helpers such as CommonText, CommonButton, FastToast, and FastLoading. A global constant module records routing path constants.
Feature packages
Business libraries are split by purpose. Feature home holds code examples as a static package using har. Feature setting holds the Huawei account service example as a static package. Feature hsp page holds dynamic package interaction examples as an hsp share package. The split between static and dynamic packaging is the point the README makes with these examples.
Cloud and account setup
Cloud function usage points to a config file at AppScope resources rawfile agconnect-services.json, exported from the AGC project, with a link to the Huawei developer guide for calling cloud functions. Cloud database usage has a schema config at entry src main resources rawfile schema.json, with example fields of id as an integer primary key, content as a string, and time as a string. The account service example links to the Huawei quick login guide and lists development preparation: configuring a client ID and configuring permissions, including sensitive permissions.
Editorial conclusion
The README doubles as a short design tour: modules, feature packages, cloud services, and the account setup steps all get a table or a config path. The target is HarmonyOS NEXT development.
Community notes