Name Date Size

..25-Oct-20244 KiB

.gitignoreH A D25-Oct-2024100

AppScope/H25-Oct-20244 KiB

build-profile.json5H A D25-Oct-20241 KiB

entry/H25-Oct-20244 KiB

hvigor/H25-Oct-20244 KiB

hvigorfile.jsH A D25-Oct-2024168

hvigorwH A D25-Oct-20242.1 KiB

hvigorw.batH A D25-Oct-20242 KiB

oh-package.json5H A D25-Oct-2024814

ohosTest.mdH A D25-Oct-20241.1 KiB

README.mdH A D25-Oct-20241.3 KiB

README_zh.mdH A D25-Oct-20243.8 KiB

screenshots/device/H25-Oct-20244 KiB

README.md

1# Observer
2
3### Overview
4
5This sample demonstrates how to use observer APIs to subscribe to events of network status, signal status, call status, cellular data, and SIM card status changes.
6
7![](./screenshots/device/observer-en.png)
8
9
10### Concepts
11
12`@ohos.telephony.observer`
13
14  A module that allows you to register observers to subscribe to events of mobile network, signal, call, and SIM card status changes.
15
16### Required Permissions
17
18The following permission must be declared in the `module.json5` file:
19
20**ohos.permission.GET_NETWORK_INFO**: Obtains the network status.
21
22**ohos.permission.READ_CALL_LOG**: Obtains the call status.
23
24### How to Use
25
261. Open the application and enable all event subscription switches.
27
282. Enable or disable the mobile network once to trigger a network status change.
29
303. Make a call to trigger a call status change.
31
324. Remove and insert the SIM card to trigger a SIM card status and signal status change.
33
345. Touch the **Details** button. A page is displayed, showing the related status change events.
35
36### Constraints
37
381. This sample can only be run on standard-system devices.
39
402. This sample demonstrates the stage model, which supports only API version 9.
41
423. This sample requires DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100) to compile and run.
43