Development of today’s Android* devices and the applications for those devices includes focusing on continuous improvement on power optimization to reduce power consumption and prolong battery life for the mobile device.
Generally, expectations of most users today are that an Android mobile device’s battery charge will last at least one 24-hour period. Such user expectations may be unrealistic if the user doesn’t realize that one of the reasons for the rapid power discharge is due to the use of applications that are not optimized to save electricity. Part of the problem can be solved by the improvements to an application so they consume less electricity. This article focuses on ways to optimize application power consumption so that applications and the Android device meet user expectations and thus improve the user experience with the device.
Parallelism and Multithreading
Today, Android devices use multi-core processors. Using all available cores not only improves performance for the device but also saves energy. When you make use of the largest number of simultaneous threads or cores, the program will run faster, while consuming less electricity.
One of the main reasons for the high power consumption in the active state of the application is the high frequency of system calls. Common sources of synchronization calls at the core level are transitions between an active state and an idle state. If you combine periodic actions and avoid unnecessary transitions between an active state and an idle state, it will be possible to increase the parallelism of the streams. These changes along with implementing multithreading will reduce power discharge for your app.
Optimization of Often Used Code
This is one of the basic principles. Optimization of the most frequently used code achieves the highest win, so you should start with this. One way to improve this code is by using the most current vector instructions, such as SSE, AVX, etc. These instructions help you perform common actions quickly while requiring less power.
Reducing Memory Usage
Optimizing memory usage also helps reduce power consumption in active applications. To reduce memory usage you need to:
- Avoid unnecessary graphics format conversions (e.g. conversion from YUV to RGB and back) to access the GPU and CPU
- Cache frequently-used data structures
- Limit the amount of movement of data between kernel space and user space
As the development and production of Android devices accelerate, developers will continue to play a major role in creating more efficient versions—requiring lower power consumption—for applications and to continually address power optimization issues.
About The Author
Denis Smirnov (email@example.com) is a Software Intern and has worked at Intel as a Technical Intern for nine months. Denis is getting his master’s degree in Computer Science in the Nizhny Novgorod State Technical University, specializing in Applied Mathematics.
Related Articles and Resources
- Windows 8* Software Power Optimization
- Power Optimization: Furthering the Mobile Vision