diff --git a/README.en.md b/README.en.md index 64f4563b1b13ce79110b7ccdd2533ddc2a2cde1d..006accedfb7851a154fe1261a3e6be035ca73502 100644 --- a/README.en.md +++ b/README.en.md @@ -4,7 +4,7 @@ This sample shows the features related to common events for monitoring some user operations. Specifically, the following features are implemented: -1. Subscribe to system common events to monitor user operations (such as turning on or off the screen, locking or unlocking the screen, and disconnecting from the network). +1. Subscribe to system common events to monitor user operations (such as turning on or off the screen, locking or unlocking the screen, and disconnecting from the Wi-Fi). 2. After the users stop monitoring, you can publish custom ordered common events to persistently listen for the user operations. @@ -24,7 +24,7 @@ This sample shows the features related to common events for monitoring some user 2. On the home page, four buttons, namely **Enter**, **History**, **Settings**, and **About**, are available. -3. Tap **Enter** to access the monitoring page. Tap **Start Monitoring** on the home page to start listening for system common events and count the time, after which the button changes to **Stop Monitoring**. Tap this button to show the monitoring duration and received interference information on the page. Tap the **Details** button on the lower right corner to access the details page and view the interference information. Currently, the application only listens for system common events that can be operated by users, such as turning on or off the screen, locking or unlocking the screen, and disconnecting from the network. The common events can be quickly extended as required. +3. Tap **Enter** to access the monitoring page. Tap **Start Monitoring** on the home page to start listening for system common events and count the time, after which the button changes to **Stop Monitoring**. Tap this button to show the monitoring duration and received interference information on the page. Tap the **Details** button on the lower right corner to access the details page and view the interference information. Currently, the application only listens for system common events that can be operated by users, such as turning on or off the screen, locking or unlocking the screen, and disconnecting from the Wi-Fi. The common events can be quickly extended as required. 4. Return to the home page and tap **History** to view the historical records of user operations. Currently, a maximum of 10 historical records can be stored during each runtime; otherwise, the exceeded records will be deleted. @@ -79,7 +79,7 @@ This sample shows the features related to common events for monitoring some user * Reference APIs: @ohos.app.ability.common and @ohos.data.preferences * Settings module - * This module uses application context and consists of three events: turning on or off the screen, locking or unlocking the screen, and disconnecting from the network. Three options including **Always**, **Only this time**, and **Never** can be configured for each event. You can use the **commonEvent.publish** method to publish common events and use the **getPreferences** method to obtain the **Preferences** instance to develop function pages. + * This module uses application context and consists of three events: turning on or off the screen, locking or unlocking the screen, and disconnecting from the Wi-Fi. Three options including **Always**, **Only this time**, and **Never** can be configured for each event. You can use the **commonEvent.publish** method to publish common events and use the **getPreferences** method to obtain the **Preferences** instance to develop function pages. * Source code links: [Header.ets](entry/src/main/ets/component/Header.ets), [Consts.ets](entry/src/main/ets/module/Consts.ets), [SettingFeature.ets](entry/src/main/ets/feature/SettingFeature.ets), and [SurveillanceEventsManager.ets](entry/src/main/ets/module/SurveillanceEventsManager.ets) * Reference APIs: @ohos.app.ability.common, @ohos.data.preferences, @ohos.commonEvent, and @ohos.router diff --git a/README.md b/README.md index 2a6b80c7ab1abd563dee1692b756e63f92d8dbb0..6becd1dc1c8032d05bad530444526de0cf53ed6c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 本示例主要展示了公共事件相关的功能,实现了一个检测用户部分行为的应用。具体而言实现了如下几点功能: -1.通过订阅系统公共事件,实现对用户操作行为(亮灭屏、锁屏和解锁屏幕、断联网)的监测; +1.通过订阅系统公共事件,实现对用户操作行为(亮灭屏、锁屏和解锁屏幕、Wi-Fi状态变化)的监测; 2.通过在用户主动停止监测行为时发布自定义有序公共事件,实现对用户主动触发监听行为的持久化记录; @@ -24,7 +24,7 @@ 2.进入应用显示菜单页,可选择“进入”,“历史”,“设置”及“关于”几个选项。 -3.点击“进入”后跳转至主页面,点击主页面“开始监控”按钮,将开始监听系统公共事件,并进行计时,此时按钮内容变更为“停止监听”;点击停止监听按钮,页面上将显示本次监听时长及监听期间收到的干扰信息汇总,并在页面右下角显示“查看详情”按钮,点击按钮将跳转至详情页,显示监听期间收到的干扰信息,应用当前仅监听了亮灭屏、锁屏和解锁屏幕、断联网等用户可操作的系统公共事件,后续可根据需求快速扩展。 +3.点击“进入”后跳转至主页面,点击主页面“开始监控”按钮,将开始监听系统公共事件,并进行计时,此时按钮内容变更为“停止监听”;点击停止监听按钮,页面上将显示本次监听时长及监听期间收到的干扰信息汇总,并在页面右下角显示“查看详情”按钮,点击按钮将跳转至详情页,显示监听期间收到的干扰信息,应用当前仅监听了亮灭屏、锁屏和解锁屏幕、Wi-Fi状态变化等用户可操作的系统公共事件,后续可根据需求快速扩展。 4.返回至应用菜单页面,点击“历史”可查看用户操作监听的历史记录,当前支持每次运行期间最多存储10条历史记录,超过10条后将删除历史数据。 @@ -79,7 +79,7 @@ * 参考接口:@ohos.app.ability.common,@ohos.data.preferences * 设置模块 - * 本模块分为三个事件,分别为记录联网事件,记录灭屏事件,记录亮屏事件,进行锁屏事件、进行解锁屏幕事件,每一个事件都可进行一直,仅本次和从不的单项选择,使用到应用文上下文吗,CommonEvent.publish发布公共事件,getPreferences方法获取Preferences实例进行功能页面开发。 + * 本模块分为三个事件,分别为记录Wi-Fi状态变化事件,记录灭屏事件,记录亮屏事件,进行锁屏事件、进行解锁屏幕事件,每一个事件都可进行一直,仅本次和从不的单项选择,使用到应用文上下文吗,CommonEvent.publish发布公共事件,getPreferences方法获取Preferences实例进行功能页面开发。 * 源码链接:[Header.ets](entry/src/main/ets/component/Header.ets),[Consts.ets](entry/src/main/ets/module/Consts.ets),[SettingFeature.ets](entry/src/main/ets/feature/SettingFeature.ets),[SurveillanceEventsManager.ets](entry/src/main/ets/module/SurveillanceEventsManager.ets) * 参考接口:@ohos.app.ability.common,@ohos.data.preferences,@ohos.commonEvent, @ohos.router diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json index 4908ef2f726ddfa545bedb95c9f79c362a6b981a..9385184398f04ca7c736f1bf9ff7525f955850d6 100644 --- a/entry/src/main/resources/zh_CN/element/string.json +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -98,7 +98,7 @@ }, { "name": "enable_wifi", - "value": "是否记录联网事件" + "value": "是否记录Wi-Fi状态变化事件" }, { "name": "start_time",