O'Reilly logo

Quick Recipes on Symbian OS: Mastering C++ Smartphone Development by Michael Aubert

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Next Level Development

This chapter gives you a glimpse of some advanced features of Symbian OS. If you want to take full advantage of these features, you will probably need to use some additional resources, such as the Symbian Developer Library, Symbian Press books or technical papers available on Symbian C++ developer community websites.

Advanced Technologies

Publish and Subscribe: System-wide Properties

You can find a full introduction to the Publish and Subscribe API at developer.symbian.com/main/downloads/papers/publishandsubscribe/PublishAndSubscribe_v1.0.pdf.

The Publish and Subscribe API in Symbian OS is basically a kernel-side hashtable that can only contain one value per key. The key of the hashtable should be a UID that you allocated. The value of the hashtable is a TInt or a TDesC (binary data or text, limited to 512 bytes).

Your code accesses the hashtable through the RProperty class. The API is fairly basic: add/remove key, get/set value. You can also receive notification if a value changes using RProperty::Subscribe(), which is an asynchronous request. Only one such request is allowed per RProperty instance at any given time.

Each property belongs to a category, identified by yet another UID. The category UID defaults to the secure identifier of the current process. It can be useful to you as a developer to have a look at all the properties in the KUidSystemCategoryValue category.

The main issue with the system category is to find all the property keys that belong ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required