Telephony Watcher Tutorial

This tutorial describes how to use the telephony watchers in Symbian platform.

The telephony watchers provide the signal strength and the call indicator information to all the registered clients applications. The client application must register with the Publish and Subscribe framework to receive the information. The telephony watchers enable the clients to retrieve information about network signal strength and call status.

  1. Create an instance of watchers If the watcher was started earlier, re-start them to reset the values.
  2. Create a handle to the publish and subscribe with RProperty::Attach(). Input the system category and the property key as the argument. The keys are defined in the system agent header sacls.h. Use KUidCurrentCall for call status and KUidNetworkStatus for network status information.
  3. Use RPropety::Subscribe() to subscribe to the property and use RProperty::Get() to retrieve the updated information.
  4. The retrieved information can be displayed to the user.

  5. Follow the steps 1 - 4 to retrieve the other value.

Watcher example

The example code below describes how to retrieve the network signal status with the telephony watcher.


//assume that the watcher is stopped 

StartWatcher();

TInt state;
TRequestStatus    status;
RProperty property;


//initial network status

TInt ret = RProperty.Get(KUidSystemCategory, KUidChargerStatus.iUid, state);

// display the value
...

//attach to the network status property

ret = property.Attach(KUidSystemCategory,KUidNetworkStatus.iUid);


//subscripe to the property

property.Subscribe(status);

User::WaitForRequest(status);

property.Subscribe(status);
propertty.Get(state);

//display the value
...