# SystemCommonEvent **Repository Path**: llince/SystemCommonEvent ## Basic Information - **Project Name**: SystemCommonEvent - **Description**: 通过订阅、退订Wi-Fi连接状态事件和电池充电状态事件,实现订阅、退订系统公共事件。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 6 - **Created**: 2024-09-21 - **Last Updated**: 2025-09-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Common System Events ## Introduction This codelab introduces how to subscribe to and unsubscribe from the Wi-Fi connection state event and battery state event. The following figure shows the effect. ![](screenshots/device/SystemCommonEvent.en.gif) ## Concepts - Common events: HarmonyOS provides Common Event Service (CES) for applications to subscribe to, publish, and unsubscribe from common events. Common events are classified into system common events and custom common events. ## Permissions N/A ## How to Use 1. Open the app and go to the system common events page. 2. Dynamically subscribe to the system common events of the Wi-Fi connection and charging state of the mobile phone. 3. When a common event is published, the application can receive the state change of the subscribed common event. 4. Unsubscribe from common system events. ## Constraints 1. The sample app is supported only on Huawei phones running the standard system. 2. HarmonyOS: HarmonyOS 5.0.5 Release or later 3. DevEco Studio: DevEco Studio 5.0.5 Release or later 4. HarmonyOS SDK: HarmonyOS 5.0.5 Release SDK or later