Chapter 4. Event-Driven Programming

Power conservation is important in mobile devices since battery life is usually one of the top three reasons a consumer will choose a particular device. Mobile software must be designed to be frugal in its use of hardware components that consume power, such as the CPU, display and radio units. These power-sink hardware components usually have various modes of operation including low-power modes which can be used to minimize power drain whenever the hardware components, or software services related to them, are not in use. An example of a power-sink component and a related service might be a Bluetooth radio unit and a Bluetooth device discovery service. Such hardware components are often encapsulated as shared resources in Symbian OS and are managed on behalf of the programs that use them (often using a reference counting mechanism).

One power-sink hardware component that all programs utilize is the CPU. The software running on a mobile device has a direct influence upon the power consumed by the CPU. This is because the CPU uses power for each CPU cycle executed. The fewer CPU cycles needed to execute a piece of functionality, the less power the device uses. This applies to all types of software, from device drivers for hardware resources to user-level applications. All Symbian developers should understand and apply these patterns throughout their software design and development.

Consider an indicator on a mobile phone that shows whether a Bluetooth ...

Get Common Design Patterns for Symbian OS: The Foundations of Smartphone Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.