SlideShare a Scribd company logo
How to lower the power consumption of
your app, without affecting performance
Rick Schwartz
Qualcomm Technologies, Inc.
developer.qualcomm.com
mostly-tech.com
About this session
•Most mobile apps do not use the processor, cellular radio
and other system resources efficiently
• This wastes power, which has a negative effect on battery
life
•It’s easy to measure power consumption. If you can
measure it, you can act on it
•Solutions to common power problems are readily available
•Better battery life = happier users
Battery life really matters
Why long battery life is such a challenge
Hardware specs have increased dramatically, but batteries have not
Source: Samsung.com/us website
Samsung Galaxy SIII
Samsung Galaxy S6
So, where does the power go?
Source: Android Power Profile for the Nexus 6 smartphone. Data provided by device
manufacture. Current converted to power
#1
#3
#2 CPU
#4
#5
#6
How to get a power profile for any phone
•Read up on Android Power Profiles:
https://source.android.com/devices/tech/power/index.html
•Where to find one on your device:
platform/frameworks/base/core/res/res/xml/power_profile.xml
•There’s also an app for this
•Values are displayed in current
P = I x V (battery voltage)
Power Profile app on Google Play
How much power does your app consume?
Measuring power using Trepn™ Profiler
Launch Trepn, go to Settings
and select Battery Power
Check “Acquire Wakelock to
keep the processor awake
Select an app to profile
1 2 3
Source: Trepn Profiler screenshots. Trepn is a product of Qualcomm Technologies Inc.
Measuring power using Trepn Profiler
Source: Trepn Profiler screenshots. Trepn is a product of Qualcomm Technologies Inc.
4 Select how to view the power data
Other software options are available
Android 5.0 Battery app GSam Battery Monitor Pro GameBench Power Tutor
If you can measure it, you can act on it
•First, measure the power of your device idle with the
screen on and off
•Next, measure the average power of your app when it’s
idle and in-use
•Compare the power consumption of your app to other
similar apps
•Try different things:
- Does code A or code B consume more power?
Inserting markers into your code
Trepn Profiler’s application states help identify the cause of power spikes
Step 1: Insert application state markers into your code
Step 2: Look for spikes in Trepn’s graph
view. Determine which section of code they
occur in
Source: Trepn Profiler 5.0 screenshots
Step 3: Make changes to your code, and look at the average
power readings for each state in Trepn’s Stats view
Reading the power consumption from the power management IC results in a strong
correlation between system resource usage and the power used
Source: Trepn Profiler 5.0 running GLBench
The advantage of direct power measurement
Are software power measurements accurate?
The chart shows how Trepn’s power readings compare to a Monsoon Power Monitor
Source: Qualcomm internal power measurements of a Nexus 6 running Trepn software at various screen brightness levels
How to perform automated testing
A simple example how this can be done
Source: Trepn Profiler 5.0 screenshot
Making intelligent decisions
Source: Trepn screenshots of Nexus 5 running MX Player
Video playback using S/W decoder Video playback using H/W decoder
43% less power consumedAlmost 3x more CPU load
Trepn shows how much power is saved when using hardware decoding
Pros and cons of software and hardware power
measurement
Software Power Measurement
• Much easier – Doesn’t require modifications to the battery or phone
• More portable – Doesn’t require a cable connection; Supports mobile use
cases
• Capable of per-rail power measurements for hardware blocks
• Not every device supports direct power measurement
Hardware Power Measurement
• More accurate - Off-target, so it doesn’t consume processor cycles
• Often provides more detailed and customizable graphs
• Misses less spikes - Capable of higher sample rates
Measuring per-rail power consumption
Snapdragon development tablets are available from
• The Snapdragon 805 (8084) MDP displays power for the CPU, Camera, Digital Core, GPU,
Internal Memory, LCD Backlight, SD Card and WLAN/Bluetooth
• The Snapdragon 810 (8994) MDP displays power for the CPU Cores 0-3, CPU Cores 4-7,
GPU, LCD Backlight, Front Camera, Rear Camera, System Memory, Internal Memory/SD
Card, Wi-Fi/Bluetooth, Sensors and USB
Power delta before photo taken Power delta after photo taken
Source: Trepn Profiler 5.0 screenshots
Qualcomm Snapdragon is a product of Qualcomm Technologies, Inc.
1. Direct connection to the battery
contacts via mini-grabber cables
2. Using flat insulated copper tape
3 different ways to connect your device to
power measurement hardware*
3. Circuit board modification
Sources: Nexus photos taken by the authorNote: Any connection to power measurement hardware is done at your own risk
Power Measurement Best Practices
1. Remove your USB cable – You cannot display accurate power readings when your
mobile device is charging or connected to a computer. Tip: Use ADB over Wi-Fi
2. Make sure the CPU in the device capturing the power data stays awake
3. Minimize background processes – Open the Apps manager, go to Running and close
all remaining unneeded apps and stop all unneeded services
4. Focus on what you’re measuring – Turn off everything that is not related to what
you want to measure (e.g., Wi-Fi, Mobile networks, Location (GPS), Bluetooth,
Google Now, etc.)
5. Minimize the impact of the screen – The screen is the biggest consumer of power.
Turn the brightness down to the minimum possible level or turn it off
6. More power measurement Best Practices are available here
Does your app have a power problem?
The Top 5 power problems
Does your app use the cellular radio efficiently?
Many apps don’t use the cellular radio efficiently
Multiple apps acting independently creates
network signaling congestion
• Apps pull notifications, updates and message users -
- even when a phone is not being used
• Most news and social networking apps wake up your
device at least four times an hour
Source: The Smartphone Challenge: Signaling Congestion and Power Consumption - Gerardo Giaretta - Qualcomm
Why is this a problem?
• A dormant cellular radio consumes
about 10-12 mA
• When data is sent or received, the
radio comes up and goes into an
active state, consuming 250-350mA
• When not sending data, the radio
drops down to idle, but still
consumes about 30mA to 150mA
• After a timeout of 8 to 15 seconds,
the radio finally goes back to a
dormant state
Source: Qualcomm Technologies Inc. internal testing
Is your app is using the cellular radio efficiently?
Use AT&T’s Application Resource Optimizer (ARO )to find out
You can download it here: https://developer.att.com/application-resource-optimizer/get-aro
Source: Screen image used with permission
What else can you do with ARO?
• Collects traces from a test device or Android emulators
• Provides detailed recommendations how to fix problems
• Open-source code can be integrated into automated test suites
Source: Screen image used with permission
ARO Test Results
Screen images used with permission
Real world cellular radio power consumption
1. Radio goes from idle to transmitting
- Power increase >800mW
2. Radio back to idle
- Power decrease >800mW
3. Radio goes from idle to transmitting
- Power increase >1200mW
4. Radio goes from idle to transmitting
- Power increase >600mW
5. Radio goes from idle to transmitting
- Power increase <500mW
6. Radio goes from idle to transmitting
- Power increase <500mW
7. Radio goes from idle to dormant
- Power decrease ~600mW
8. Radio goes from idle to transmitting
- Power decrease ~500mW
1 2 3 4 5 6 7 8
Source: Qualcomm Technologies Inc. internal testing using Trepn Profiler to graph the
mobile data states of a Nexus 7 with LTE accessing data from Google Drive
Charts make it easier to correlate actions with
system resource consumption
Source: Trepn plug-in for Eclipse running on an active Samsung Galaxy Note 3
Don’t forget to check idle behavior
All 4 cores are
active here
GPU active here
250mA to 350mA of
power is used here Even though the cellular radio is idle, it still consumers up to 150mA of power
GPS active here
Wi-Fi active
here
Source: Trepn plug-in for Eclipse running on an idle Samsung Galaxy Note 3
Make changes and see the impact
Mobile data transmitted before Google Now turned off
Mobile data transmitted after Google Now turned off
Google Search app
Source: Trepn plug-in screen excerpts
Small changes can make a big difference in cellular radio usage
How to efficiently use the cellular radio
How to efficiently use the cellular radio
1. Connect less often – After you transmit the radio stays on for 10+ sec1
2. Push, don’t poll – Send packets and wait to see if they respond. Use
the Google Cloud Messaging system (GCM) API instead. Have it send you
data when things have changed. Specify how often items are delivered2
3. Don’t continuously scan1
1. Create timeouts appropriately when scanning for Wi-Fi networks or GPS signals
4. Offer ad-free versions – Apps without ads connect to the network much
less often
5. Use analytics wisely1
1. Capture data locally and group transmissions to your server. Extend the time
between transmissions
1 Source: AT&T “Tips to Increase Battery Life Handout” from AnDevCon 2013
2 Source: Google Developer Advocate Colt McAnlis at from “Efficient battery use on mobile” at “Perf Like a Pirate.”
Analytic and ad services vary greatly
Source: Data provided by Crittercism
Error rates and response times by top services
Findings
• Google Analytics has lowest error
rate (0.1%); error rate is percent of
errors per number of service calls
made
• Of top public services, Google
Analytics has lowest average latency
Takeaway
• Even top services like Google
Analytics and Facebook experience
latency and error rates
• Teams must manage every aspect of
mobile app performance, including
third-party services
Follow the leader(s)
BBC News App (23 SDKs) BBC website (38 SDKs)
Source: Data provided by MixRank
See which SDKs popular apps and sites use
Apache Commons ChartBeat
Simple Logging Façade for Java Facebook Open Graph
Android Volley Adobe Analytics/Omniture
OpenUDID Bing Webmaster Tools
Omniture Effective Measure
17,289 7,87329,386 46,675
12,475 4,47225,905 38,380
9,166 5,1414,285 13,451
3,296 1,3996,657 9,953
1,196 396794 1,990
Current installs Uninstalls Total installs Developers
Current installs Uninstalls Total installs Developers
Current installs Uninstalls Total installs Developers
Current installs Uninstalls Total installs Developers
Current installs Uninstalls Total installs Developers
36,641 189K Dec 4, 2013
5,880,253 402K
224,454 1M
813,284 109
8,735 975K
Websites Times Seen First Seen Last Seen
Websites Times Seen First Seen Last Seen
Websites Times Seen First Seen Last Seen
Websites Times Seen First Seen Last Seen
Websites Times Seen First Seen Last Seen
May 12, 2015
Jan 29, 2012 May 12, 2015
Jan 29, 2012 Apr 20, 2015
Apr 10, 2015
Apr 10, 2015
Jan 29, 2012
Jan 29, 2012
How to efficiently use the cellular radio
6. Don’t continuously stream – Download streams in chunks1
7. Use the JobScheduler APIs that are part of Android 5.02
1 Source: AT&T “Tips to Increase Battery Life Handout” from AnDevCon 2013
2 Google I/O 2014 - Introduction to Project Volta by (Meghan Desai and Matthew Jay Williams)
Before
After
Bundling traffic reduces overhead-to-data ratio
Source: The Smartphone Challenge: Signaling Congestion and Power Consumption - Gerardo Giaretta - Qualcomm
Use Battery Historian to view wakelocks & radio usage
One-time setup in order to run Battery Historian
1. Download and install Python 2.7 (if it’s not already installed)
2. Download battery-historian from GitHub
3. Extract “historian.py” from the zip file and copy it to the Python2.7 directory
Running Battery Historian
Type the following into the command prompt after connecting to an Android 5.x device:
How to efficiently use the cellular radio
6. Wait for the right connection – Avoid sending packets on slow
cellular connections. Wait until you are on Wi-Fi, if possible.
Some apps provide users with
the option to only upload when
charging. Choice is good.
Source: Microsoft OneDrive screen capture
Why should you wait for Wi-Fi?
Source: Qualcomm tests. Monsoon power measurement from a download of 3 apps
over a 1-2 bar 3G/4G cellular connection using a Verizon Galaxy Note 3
More power is consumed
• Power before download 723 mW
• Power during download 3279mW
• Radio power use: ~2556mW
• Downloading large files over
Wi-Fi consumes less than half
the power
• Estimated battery life dropped
from 15.8 hours to 5.1 hours
Mobile data wasted: 67.68MB
Time wasted: 11 minutes
Downloading data over a cellular radio with a
weak signal requires more power
Does your app keep the processor awake?
33
How to tell if your app keeps the processor from
going to sleep?
Using Wakelock Detector (WLD) to identify processor sleep problems
CPU Wakelocks Wakeup Triggers
• A recent study found that 23% of
apps have problems with
wakelocks. This can drain the
battery of an inactive handset in as
little as 5 hours
• Wakelocks do have a place, because
your processor goes to sleep when
it’s idle. Apps need wakelocks for
alarms, GPS location and to wake
up the processor to check for new
messages.
An easy way to spot excess resource consumption
Processor stats can be viewed by going to Settings > Battery and
selecting your application
Source: Android 5.0 battery stats screenshots
If your app is not in the foreground, there should be a good reason why it’s keeping the processor awake and consuming data
How to avoid keeping the processor awake
1. Do not acquire PowerManager.Wakelocks unless you really need them
Battery life will be significantly affected by the use of this API
• Use the minimum levels needed
• Release wakelocks as soon as possible
2. Consider using AlarmManager in situations when you want to have your
application code run at a specific time
• Beginning with KitKat, the OS shifts alarms to minimize wakeups and
battery usage
3. For normal timeouts, it’s easier and more efficient to use Handler
Does your app manage the display in a power
efficient manner?
Managing display power efficiently
1. Full wakelocks keep your screen from turning off.
To keep the display lit when your app is in the
foreground, use FLAG_KEEP_SCREEN_ON
2. There is a direct correlation between screen
brightness and power consumption
3. Offer a dark theme option. Gray or black
backgrounds consume less than half the power of
a white background
Source: Qualcomm average power measurements using a Monsoon Power Monitor of the Google New & Weather app on a Samsung Galaxy Note 3 with the display at 50% screen brightness
Source: Qualcomm tests of Nexus 6 average power consumption using a Monsoon Power monitor
Does your app use all available system resources?
Some apps don’t use resources efficiently
Source: Trepn Profiler 5.0 screenshots
Is your app CPU bound or GPU bound?
Source: Trepn Profiler 5.0 screenshots
Does it use all available CPU cores?
Source: Trepn Profiler 5.0 screenshots
Heterogeneous computing is key
Run the right task on the right processing engine
Source: Qualcomm internal power tests using QEPM software eQualcomm SeeMore demo using the MARE SDK
a product of Qualcomm Technologies, Inc.
Qualcomm Multicore Asynchronous Runtime
Environment
MARE is a developer programming library, API and
runtime system for heterogeneous programming
How to save power by offloading to DSP
Benefits of offloading to DSP
• Extends music playback time to 60 hours. A 50% increase.
• When batching sensor data, 8 hours of sleep tracking only
uses 10 to 20% of available battery life
• Running FastCV™ facial detection on DSP instead of the CPU
uses 32% less power
1. Audio playback done using a Nexus 5 using Bluetooth headphones and the display off.
2. Sensor batching done on Samsung Gear Live with Sleep as Android app
3. Power measured at the device battery. Source: Qualcomm Technologies Inc. internal measurements
Does your app take too many GPS fixes?
How to save power when using the GPS
1. Make sure you don’t take a GPS fix when
it’s not needed
2. Use coarse GPS fixes when possible,
because they require less power
3. Let LocationManager find the best provider
4. Have a timeout if you can’t find a satellite
5. Disable GPS when your app sleeps to save
power
6. Make it easy for users to disable location
tracking without crippling their device
Source: Android 5.0 Location Settings on Samsung device
Perf Matters Too!
Use tools like these to confirm your perf hasn’t changed
•ARM Streamline, GameBench, Adreno Profiler, Trepn
Profiler, PerfMon, Intel INDE or Qualcomm® Snapdragon™
Profiler
Real-time or post-capture viewing
and analysis of a wide range of
system and app level power,
performance, thermal and
network usage metrics
Coming Soon: Snapdragon Profiler
Qualcomm Snapdragon and Qualcomm Adreno are products of Qualcomm Technologies, Inc.
Recap of power saving tips
• Use wakelocks only when necessary
• Close TCP sockets when done. Otherwise, you unnecessarily bring up the network just
to tear down. This simple fix can reduce network power up to 20%
• Group network activity when possible
• Keep performance headroom for additional power savings. Saves significantly in overall
system power.
- Optimize your app to run at 60fps, but then frame-rate limit it to lower rate (ideally
30fps). This cuts GPU, CPU and memory utilization and hence related power by 50%.
Also guarantees smooth consistent UX flow at same framerate
• Avoid rendering at full native display resolutions. This saves GPU power.
- Test rendering applications at lower resolutions
- Games should ideally render at 1080p or lower resolutions natively
@YourTwitterHandle#DVXFR14{session hashtag} @mostlytech1#powermatters
Helpful mobile power-related links
• Software power measurement best practices – Rick Schwartz
• Hardware power measurement best practices – Rick Schwartz
• Battery Drain and Networking – Colt McAnlis
• What These Apps Did May Shock You - Doug Sillars
• Understanding Battery Drain on Android – Colt McAnlis
• How to power profile an app using hardware – Rick Schwartz
• Battery Drain and WakeLocks – Colt McAnlis
• AT&T Application Resource Optimizer demo - Doug Sillars
• Monsoon Power Monitor - Tips & Tricks – Rick Schwartz

More Related Content

What's hot

Xbox system ppt
Xbox system pptXbox system ppt
Xbox system ppt
VIKASH MEWAL
 
AID in android
AID in androidAID in android
AID in android
Chien-Ming Chou
 
Online shopping
Online shoppingOnline shopping
Online shopping
vibgyoreumind
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
Srijib Roy
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
Barrel Software
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
Benny Skogberg
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming Seminar
Nhat Nguyen
 
Mobile game testing report
Mobile game testing reportMobile game testing report
Mobile game testing reportQA Madness
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android Application
Mark Lester Navarro
 
Mobile Hardware
Mobile HardwareMobile Hardware
Mobile Hardware
Mohab El-Shishtawy
 
Android Security
Android SecurityAndroid Security
Android Security
Arqum Ahmad
 
"How to Market Digital Games" Game Connection presentation
"How to Market Digital Games" Game Connection presentation"How to Market Digital Games" Game Connection presentation
"How to Market Digital Games" Game Connection presentation
Steve Fowler
 
Alarms
AlarmsAlarms
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android application
Jawed akhtar
 
Comparison of mobile operating systems
Comparison of mobile operating systemsComparison of mobile operating systems
Comparison of mobile operating systems
Sumit kumar Dhanuk
 
Use case diagram
Use case diagramUse case diagram
Use case diagramAre-u
 
Firebase PPT
Firebase PPTFirebase PPT
Firebase PPT
JATIN GUPTA
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
Sriyank Siddhartha
 
Android vs Others Operating System
Android vs Others Operating SystemAndroid vs Others Operating System
Android vs Others Operating System
Shemul Hossain
 

What's hot (20)

Xbox system ppt
Xbox system pptXbox system ppt
Xbox system ppt
 
AID in android
AID in androidAID in android
AID in android
 
Online shopping
Online shoppingOnline shopping
Online shopping
 
Basic android-ppt
Basic android-pptBasic android-ppt
Basic android-ppt
 
Mobile application development
Mobile application developmentMobile application development
Mobile application development
 
Android Application Development
Android Application DevelopmentAndroid Application Development
Android Application Development
 
Android Programming Seminar
Android Programming SeminarAndroid Programming Seminar
Android Programming Seminar
 
Mobile game testing report
Mobile game testing reportMobile game testing report
Mobile game testing report
 
Databases in Android Application
Databases in Android ApplicationDatabases in Android Application
Databases in Android Application
 
Mobile Hardware
Mobile HardwareMobile Hardware
Mobile Hardware
 
Android Security
Android SecurityAndroid Security
Android Security
 
"How to Market Digital Games" Game Connection presentation
"How to Market Digital Games" Game Connection presentation"How to Market Digital Games" Game Connection presentation
"How to Market Digital Games" Game Connection presentation
 
Alarms
AlarmsAlarms
Alarms
 
Synopsis on android application
Synopsis on android applicationSynopsis on android application
Synopsis on android application
 
Comparison of mobile operating systems
Comparison of mobile operating systemsComparison of mobile operating systems
Comparison of mobile operating systems
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
Firebase PPT
Firebase PPTFirebase PPT
Firebase PPT
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Firebase on Android: The Big Picture
Firebase on Android: The Big PictureFirebase on Android: The Big Picture
Firebase on Android: The Big Picture
 
Android vs Others Operating System
Android vs Others Operating SystemAndroid vs Others Operating System
Android vs Others Operating System
 

Viewers also liked

Task Resource Consumption Prediction for Scientific Applications and Workflows
Task Resource Consumption Prediction for Scientific Applications and WorkflowsTask Resource Consumption Prediction for Scientific Applications and Workflows
Task Resource Consumption Prediction for Scientific Applications and Workflows
Rafael Ferreira da Silva
 
Database performance with Enterprise-class Kingston SSDs
Database performance with Enterprise-class Kingston SSDsDatabase performance with Enterprise-class Kingston SSDs
Database performance with Enterprise-class Kingston SSDs
Principled Technologies
 
Schneider electric home systems solar decathlon 2011
Schneider electric home systems solar decathlon 2011Schneider electric home systems solar decathlon 2011
Schneider electric home systems solar decathlon 2011Schneider Electric
 
7 Ways to unlock value from Smartmeter Big Data
7 Ways to unlock value from Smartmeter Big Data7 Ways to unlock value from Smartmeter Big Data
7 Ways to unlock value from Smartmeter Big Data
Derick Jose
 
Android 电源管理 power_management_(英文版)
Android 电源管理 power_management_(英文版)Android 电源管理 power_management_(英文版)
Android 电源管理 power_management_(英文版)
borderj
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
natdefreitas
 
Android System Design And Power Management
Android System Design And Power ManagementAndroid System Design And Power Management
Android System Design And Power ManagementNilay Mishra
 
Learn about energy consumption and battery life on Android devices
Learn about energy consumption and battery life on Android devicesLearn about energy consumption and battery life on Android devices
Learn about energy consumption and battery life on Android devices
Marakana Inc.
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trends
Soumya Kanti Datta
 
Android Platform Overview - Azercell Barama
Android Platform Overview - Azercell BaramaAndroid Platform Overview - Azercell Barama
Android Platform Overview - Azercell Barama
Ramin Orujov
 
Android power management
Android power managementAndroid power management
Android power managementJerrin George
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Egor Elizarov
 
Android Accessibility - The missing manual
Android Accessibility - The missing manualAndroid Accessibility - The missing manual
Android Accessibility - The missing manual
Ted Drake
 
Seminar android presentation
Seminar android presentationSeminar android presentation
Seminar android presentation
Shruti Maheshwari
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar report
dgpune
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
Naresh Chintalcheru
 
Eddystone beacons: Everything you need to know
Eddystone beacons: Everything you need to knowEddystone beacons: Everything you need to know
Eddystone beacons: Everything you need to know
Beaconstac
 
power consumption of household equipments in india
power consumption of household equipments in indiapower consumption of household equipments in india
power consumption of household equipments in india
Albi Thomas
 

Viewers also liked (20)

Task Resource Consumption Prediction for Scientific Applications and Workflows
Task Resource Consumption Prediction for Scientific Applications and WorkflowsTask Resource Consumption Prediction for Scientific Applications and Workflows
Task Resource Consumption Prediction for Scientific Applications and Workflows
 
Database performance with Enterprise-class Kingston SSDs
Database performance with Enterprise-class Kingston SSDsDatabase performance with Enterprise-class Kingston SSDs
Database performance with Enterprise-class Kingston SSDs
 
Schneider electric home systems solar decathlon 2011
Schneider electric home systems solar decathlon 2011Schneider electric home systems solar decathlon 2011
Schneider electric home systems solar decathlon 2011
 
7 Ways to unlock value from Smartmeter Big Data
7 Ways to unlock value from Smartmeter Big Data7 Ways to unlock value from Smartmeter Big Data
7 Ways to unlock value from Smartmeter Big Data
 
Android 电源管理 power_management_(英文版)
Android 电源管理 power_management_(英文版)Android 电源管理 power_management_(英文版)
Android 电源管理 power_management_(英文版)
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Android System Design And Power Management
Android System Design And Power ManagementAndroid System Design And Power Management
Android System Design And Power Management
 
Learn about energy consumption and battery life on Android devices
Learn about energy consumption and battery life on Android devicesLearn about energy consumption and battery life on Android devices
Learn about energy consumption and battery life on Android devices
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trends
 
Power management android
Power management androidPower management android
Power management android
 
Android Platform Overview - Azercell Barama
Android Platform Overview - Azercell BaramaAndroid Platform Overview - Azercell Barama
Android Platform Overview - Azercell Barama
 
Android power management
Android power managementAndroid power management
Android power management
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
 
Android Accessibility - The missing manual
Android Accessibility - The missing manualAndroid Accessibility - The missing manual
Android Accessibility - The missing manual
 
Seminar android presentation
Seminar android presentationSeminar android presentation
Seminar android presentation
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar report
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
Eddystone beacons: Everything you need to know
Eddystone beacons: Everything you need to knowEddystone beacons: Everything you need to know
Eddystone beacons: Everything you need to know
 
power consumption of household equipments in india
power consumption of household equipments in indiapower consumption of household equipments in india
power consumption of household equipments in india
 

Similar to How to Lower Android Power Consumption Without Affecting Performance

Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
rickschwar
 
HH QUALCOMM how to minimize the power consumption of your app
HH QUALCOMM how to minimize the power consumption of your appHH QUALCOMM how to minimize the power consumption of your app
HH QUALCOMM how to minimize the power consumption of your app
Satya Harish
 
How to Minimize Your App’s Power Consumption
How to Minimize Your App’s Power Consumption How to Minimize Your App’s Power Consumption
How to Minimize Your App’s Power Consumption
Qualcomm Developer Network
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimization
wipjam
 
Beyond Traditional Mobile Testing
Beyond Traditional Mobile TestingBeyond Traditional Mobile Testing
Beyond Traditional Mobile Testing
ColomboCampsCommunity
 
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
NITHIN S.S
 
Is your mobile app up to speed softwaresymposium
Is your mobile app up to speed softwaresymposiumIs your mobile app up to speed softwaresymposium
Is your mobile app up to speed softwaresymposiumDoug Sillars
 
Innovate 2013 session 1243 mobile testing.v3
Innovate 2013   session 1243 mobile testing.v3Innovate 2013   session 1243 mobile testing.v3
Innovate 2013 session 1243 mobile testing.v3
Leigh Williamson
 
Making awesome apps
Making awesome appsMaking awesome apps
Making awesome apps
DroidConTLV
 
144 deview-2013-smartphone pm
144 deview-2013-smartphone pm144 deview-2013-smartphone pm
144 deview-2013-smartphone pmNAVER D2
 
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
Singsys Pte Ltd
 
Synapseindia mobile apps cellular networks and mobile computing part1
Synapseindia mobile apps cellular networks and mobile computing part1Synapseindia mobile apps cellular networks and mobile computing part1
Synapseindia mobile apps cellular networks and mobile computing part1
saritasingh19866
 
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0cSmarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
Jeffrey Gardner CMgr FCMI IEng MIET
 
Self adaptive battery and context aware mobile application development
Self adaptive battery and context aware mobile application developmentSelf adaptive battery and context aware mobile application development
Self adaptive battery and context aware mobile application development
Soumya Kanti Datta
 
House_Electrical_Switches_Mobile_Phone_Control.pptx
House_Electrical_Switches_Mobile_Phone_Control.pptxHouse_Electrical_Switches_Mobile_Phone_Control.pptx
House_Electrical_Switches_Mobile_Phone_Control.pptx
NeilIvanNava
 
Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...JPINFOTECH JAYAPRAKASH
 
Experitest & Hexaware Co-Webinar
Experitest & Hexaware Co-WebinarExperitest & Hexaware Co-Webinar
Experitest & Hexaware Co-Webinar
Experitest
 

Similar to How to Lower Android Power Consumption Without Affecting Performance (20)

Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
Samsung Developer's Conference - Maximize App Performance while Minimizing Ba...
 
HH QUALCOMM how to minimize the power consumption of your app
HH QUALCOMM how to minimize the power consumption of your appHH QUALCOMM how to minimize the power consumption of your app
HH QUALCOMM how to minimize the power consumption of your app
 
How to Minimize Your App’s Power Consumption
How to Minimize Your App’s Power Consumption How to Minimize Your App’s Power Consumption
How to Minimize Your App’s Power Consumption
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimization
 
Beyond Traditional Mobile Testing
Beyond Traditional Mobile TestingBeyond Traditional Mobile Testing
Beyond Traditional Mobile Testing
 
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
 
Is your mobile app up to speed softwaresymposium
Is your mobile app up to speed softwaresymposiumIs your mobile app up to speed softwaresymposium
Is your mobile app up to speed softwaresymposium
 
Innovate 2013 session 1243 mobile testing.v3
Innovate 2013   session 1243 mobile testing.v3Innovate 2013   session 1243 mobile testing.v3
Innovate 2013 session 1243 mobile testing.v3
 
gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900
 
Making awesome apps
Making awesome appsMaking awesome apps
Making awesome apps
 
synopsis
synopsissynopsis
synopsis
 
144 deview-2013-smartphone pm
144 deview-2013-smartphone pm144 deview-2013-smartphone pm
144 deview-2013-smartphone pm
 
Android Battery optimization Android Apps
Android Battery optimization Android AppsAndroid Battery optimization Android Apps
Android Battery optimization Android Apps
 
Synapseindia mobile apps cellular networks and mobile computing part1
Synapseindia mobile apps cellular networks and mobile computing part1Synapseindia mobile apps cellular networks and mobile computing part1
Synapseindia mobile apps cellular networks and mobile computing part1
 
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0cSmarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
Smarter Apps for Smarter phones - see me at bit.ly/1ezHj0c
 
AndroidAppPPT
AndroidAppPPTAndroidAppPPT
AndroidAppPPT
 
Self adaptive battery and context aware mobile application development
Self adaptive battery and context aware mobile application developmentSelf adaptive battery and context aware mobile application development
Self adaptive battery and context aware mobile application development
 
House_Electrical_Switches_Mobile_Phone_Control.pptx
House_Electrical_Switches_Mobile_Phone_Control.pptxHouse_Electrical_Switches_Mobile_Phone_Control.pptx
House_Electrical_Switches_Mobile_Phone_Control.pptx
 
Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...
 
Experitest & Hexaware Co-Webinar
Experitest & Hexaware Co-WebinarExperitest & Hexaware Co-Webinar
Experitest & Hexaware Co-Webinar
 

Recently uploaded

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 

How to Lower Android Power Consumption Without Affecting Performance

  • 1. How to lower the power consumption of your app, without affecting performance Rick Schwartz Qualcomm Technologies, Inc. developer.qualcomm.com mostly-tech.com
  • 2. About this session •Most mobile apps do not use the processor, cellular radio and other system resources efficiently • This wastes power, which has a negative effect on battery life •It’s easy to measure power consumption. If you can measure it, you can act on it •Solutions to common power problems are readily available •Better battery life = happier users
  • 4. Why long battery life is such a challenge Hardware specs have increased dramatically, but batteries have not Source: Samsung.com/us website Samsung Galaxy SIII Samsung Galaxy S6
  • 5. So, where does the power go? Source: Android Power Profile for the Nexus 6 smartphone. Data provided by device manufacture. Current converted to power #1 #3 #2 CPU #4 #5 #6
  • 6. How to get a power profile for any phone •Read up on Android Power Profiles: https://source.android.com/devices/tech/power/index.html •Where to find one on your device: platform/frameworks/base/core/res/res/xml/power_profile.xml •There’s also an app for this •Values are displayed in current P = I x V (battery voltage) Power Profile app on Google Play
  • 7. How much power does your app consume?
  • 8. Measuring power using Trepn™ Profiler Launch Trepn, go to Settings and select Battery Power Check “Acquire Wakelock to keep the processor awake Select an app to profile 1 2 3 Source: Trepn Profiler screenshots. Trepn is a product of Qualcomm Technologies Inc.
  • 9. Measuring power using Trepn Profiler Source: Trepn Profiler screenshots. Trepn is a product of Qualcomm Technologies Inc. 4 Select how to view the power data
  • 10. Other software options are available Android 5.0 Battery app GSam Battery Monitor Pro GameBench Power Tutor
  • 11. If you can measure it, you can act on it •First, measure the power of your device idle with the screen on and off •Next, measure the average power of your app when it’s idle and in-use •Compare the power consumption of your app to other similar apps •Try different things: - Does code A or code B consume more power?
  • 12. Inserting markers into your code Trepn Profiler’s application states help identify the cause of power spikes Step 1: Insert application state markers into your code Step 2: Look for spikes in Trepn’s graph view. Determine which section of code they occur in Source: Trepn Profiler 5.0 screenshots Step 3: Make changes to your code, and look at the average power readings for each state in Trepn’s Stats view
  • 13. Reading the power consumption from the power management IC results in a strong correlation between system resource usage and the power used Source: Trepn Profiler 5.0 running GLBench The advantage of direct power measurement
  • 14. Are software power measurements accurate? The chart shows how Trepn’s power readings compare to a Monsoon Power Monitor Source: Qualcomm internal power measurements of a Nexus 6 running Trepn software at various screen brightness levels
  • 15. How to perform automated testing A simple example how this can be done Source: Trepn Profiler 5.0 screenshot
  • 16. Making intelligent decisions Source: Trepn screenshots of Nexus 5 running MX Player Video playback using S/W decoder Video playback using H/W decoder 43% less power consumedAlmost 3x more CPU load Trepn shows how much power is saved when using hardware decoding
  • 17. Pros and cons of software and hardware power measurement Software Power Measurement • Much easier – Doesn’t require modifications to the battery or phone • More portable – Doesn’t require a cable connection; Supports mobile use cases • Capable of per-rail power measurements for hardware blocks • Not every device supports direct power measurement Hardware Power Measurement • More accurate - Off-target, so it doesn’t consume processor cycles • Often provides more detailed and customizable graphs • Misses less spikes - Capable of higher sample rates
  • 18. Measuring per-rail power consumption Snapdragon development tablets are available from • The Snapdragon 805 (8084) MDP displays power for the CPU, Camera, Digital Core, GPU, Internal Memory, LCD Backlight, SD Card and WLAN/Bluetooth • The Snapdragon 810 (8994) MDP displays power for the CPU Cores 0-3, CPU Cores 4-7, GPU, LCD Backlight, Front Camera, Rear Camera, System Memory, Internal Memory/SD Card, Wi-Fi/Bluetooth, Sensors and USB Power delta before photo taken Power delta after photo taken Source: Trepn Profiler 5.0 screenshots Qualcomm Snapdragon is a product of Qualcomm Technologies, Inc.
  • 19. 1. Direct connection to the battery contacts via mini-grabber cables 2. Using flat insulated copper tape 3 different ways to connect your device to power measurement hardware* 3. Circuit board modification Sources: Nexus photos taken by the authorNote: Any connection to power measurement hardware is done at your own risk
  • 20. Power Measurement Best Practices 1. Remove your USB cable – You cannot display accurate power readings when your mobile device is charging or connected to a computer. Tip: Use ADB over Wi-Fi 2. Make sure the CPU in the device capturing the power data stays awake 3. Minimize background processes – Open the Apps manager, go to Running and close all remaining unneeded apps and stop all unneeded services 4. Focus on what you’re measuring – Turn off everything that is not related to what you want to measure (e.g., Wi-Fi, Mobile networks, Location (GPS), Bluetooth, Google Now, etc.) 5. Minimize the impact of the screen – The screen is the biggest consumer of power. Turn the brightness down to the minimum possible level or turn it off 6. More power measurement Best Practices are available here
  • 21. Does your app have a power problem?
  • 22. The Top 5 power problems
  • 23. Does your app use the cellular radio efficiently?
  • 24. Many apps don’t use the cellular radio efficiently Multiple apps acting independently creates network signaling congestion • Apps pull notifications, updates and message users - - even when a phone is not being used • Most news and social networking apps wake up your device at least four times an hour Source: The Smartphone Challenge: Signaling Congestion and Power Consumption - Gerardo Giaretta - Qualcomm
  • 25. Why is this a problem? • A dormant cellular radio consumes about 10-12 mA • When data is sent or received, the radio comes up and goes into an active state, consuming 250-350mA • When not sending data, the radio drops down to idle, but still consumes about 30mA to 150mA • After a timeout of 8 to 15 seconds, the radio finally goes back to a dormant state Source: Qualcomm Technologies Inc. internal testing
  • 26. Is your app is using the cellular radio efficiently? Use AT&T’s Application Resource Optimizer (ARO )to find out You can download it here: https://developer.att.com/application-resource-optimizer/get-aro Source: Screen image used with permission
  • 27. What else can you do with ARO? • Collects traces from a test device or Android emulators • Provides detailed recommendations how to fix problems • Open-source code can be integrated into automated test suites Source: Screen image used with permission
  • 28. ARO Test Results Screen images used with permission
  • 29. Real world cellular radio power consumption 1. Radio goes from idle to transmitting - Power increase >800mW 2. Radio back to idle - Power decrease >800mW 3. Radio goes from idle to transmitting - Power increase >1200mW 4. Radio goes from idle to transmitting - Power increase >600mW 5. Radio goes from idle to transmitting - Power increase <500mW 6. Radio goes from idle to transmitting - Power increase <500mW 7. Radio goes from idle to dormant - Power decrease ~600mW 8. Radio goes from idle to transmitting - Power decrease ~500mW 1 2 3 4 5 6 7 8 Source: Qualcomm Technologies Inc. internal testing using Trepn Profiler to graph the mobile data states of a Nexus 7 with LTE accessing data from Google Drive
  • 30. Charts make it easier to correlate actions with system resource consumption Source: Trepn plug-in for Eclipse running on an active Samsung Galaxy Note 3
  • 31. Don’t forget to check idle behavior All 4 cores are active here GPU active here 250mA to 350mA of power is used here Even though the cellular radio is idle, it still consumers up to 150mA of power GPS active here Wi-Fi active here Source: Trepn plug-in for Eclipse running on an idle Samsung Galaxy Note 3
  • 32. Make changes and see the impact Mobile data transmitted before Google Now turned off Mobile data transmitted after Google Now turned off Google Search app Source: Trepn plug-in screen excerpts Small changes can make a big difference in cellular radio usage
  • 33. How to efficiently use the cellular radio
  • 34. How to efficiently use the cellular radio 1. Connect less often – After you transmit the radio stays on for 10+ sec1 2. Push, don’t poll – Send packets and wait to see if they respond. Use the Google Cloud Messaging system (GCM) API instead. Have it send you data when things have changed. Specify how often items are delivered2 3. Don’t continuously scan1 1. Create timeouts appropriately when scanning for Wi-Fi networks or GPS signals 4. Offer ad-free versions – Apps without ads connect to the network much less often 5. Use analytics wisely1 1. Capture data locally and group transmissions to your server. Extend the time between transmissions 1 Source: AT&T “Tips to Increase Battery Life Handout” from AnDevCon 2013 2 Source: Google Developer Advocate Colt McAnlis at from “Efficient battery use on mobile” at “Perf Like a Pirate.”
  • 35. Analytic and ad services vary greatly Source: Data provided by Crittercism Error rates and response times by top services Findings • Google Analytics has lowest error rate (0.1%); error rate is percent of errors per number of service calls made • Of top public services, Google Analytics has lowest average latency Takeaway • Even top services like Google Analytics and Facebook experience latency and error rates • Teams must manage every aspect of mobile app performance, including third-party services
  • 36. Follow the leader(s) BBC News App (23 SDKs) BBC website (38 SDKs) Source: Data provided by MixRank See which SDKs popular apps and sites use Apache Commons ChartBeat Simple Logging Façade for Java Facebook Open Graph Android Volley Adobe Analytics/Omniture OpenUDID Bing Webmaster Tools Omniture Effective Measure 17,289 7,87329,386 46,675 12,475 4,47225,905 38,380 9,166 5,1414,285 13,451 3,296 1,3996,657 9,953 1,196 396794 1,990 Current installs Uninstalls Total installs Developers Current installs Uninstalls Total installs Developers Current installs Uninstalls Total installs Developers Current installs Uninstalls Total installs Developers Current installs Uninstalls Total installs Developers 36,641 189K Dec 4, 2013 5,880,253 402K 224,454 1M 813,284 109 8,735 975K Websites Times Seen First Seen Last Seen Websites Times Seen First Seen Last Seen Websites Times Seen First Seen Last Seen Websites Times Seen First Seen Last Seen Websites Times Seen First Seen Last Seen May 12, 2015 Jan 29, 2012 May 12, 2015 Jan 29, 2012 Apr 20, 2015 Apr 10, 2015 Apr 10, 2015 Jan 29, 2012 Jan 29, 2012
  • 37. How to efficiently use the cellular radio 6. Don’t continuously stream – Download streams in chunks1 7. Use the JobScheduler APIs that are part of Android 5.02 1 Source: AT&T “Tips to Increase Battery Life Handout” from AnDevCon 2013 2 Google I/O 2014 - Introduction to Project Volta by (Meghan Desai and Matthew Jay Williams) Before After
  • 38. Bundling traffic reduces overhead-to-data ratio Source: The Smartphone Challenge: Signaling Congestion and Power Consumption - Gerardo Giaretta - Qualcomm
  • 39. Use Battery Historian to view wakelocks & radio usage One-time setup in order to run Battery Historian 1. Download and install Python 2.7 (if it’s not already installed) 2. Download battery-historian from GitHub 3. Extract “historian.py” from the zip file and copy it to the Python2.7 directory Running Battery Historian Type the following into the command prompt after connecting to an Android 5.x device:
  • 40. How to efficiently use the cellular radio 6. Wait for the right connection – Avoid sending packets on slow cellular connections. Wait until you are on Wi-Fi, if possible. Some apps provide users with the option to only upload when charging. Choice is good. Source: Microsoft OneDrive screen capture
  • 41. Why should you wait for Wi-Fi? Source: Qualcomm tests. Monsoon power measurement from a download of 3 apps over a 1-2 bar 3G/4G cellular connection using a Verizon Galaxy Note 3 More power is consumed • Power before download 723 mW • Power during download 3279mW • Radio power use: ~2556mW • Downloading large files over Wi-Fi consumes less than half the power • Estimated battery life dropped from 15.8 hours to 5.1 hours Mobile data wasted: 67.68MB Time wasted: 11 minutes Downloading data over a cellular radio with a weak signal requires more power
  • 42. Does your app keep the processor awake? 33
  • 43. How to tell if your app keeps the processor from going to sleep? Using Wakelock Detector (WLD) to identify processor sleep problems CPU Wakelocks Wakeup Triggers • A recent study found that 23% of apps have problems with wakelocks. This can drain the battery of an inactive handset in as little as 5 hours • Wakelocks do have a place, because your processor goes to sleep when it’s idle. Apps need wakelocks for alarms, GPS location and to wake up the processor to check for new messages.
  • 44. An easy way to spot excess resource consumption Processor stats can be viewed by going to Settings > Battery and selecting your application Source: Android 5.0 battery stats screenshots If your app is not in the foreground, there should be a good reason why it’s keeping the processor awake and consuming data
  • 45. How to avoid keeping the processor awake 1. Do not acquire PowerManager.Wakelocks unless you really need them Battery life will be significantly affected by the use of this API • Use the minimum levels needed • Release wakelocks as soon as possible 2. Consider using AlarmManager in situations when you want to have your application code run at a specific time • Beginning with KitKat, the OS shifts alarms to minimize wakeups and battery usage 3. For normal timeouts, it’s easier and more efficient to use Handler
  • 46. Does your app manage the display in a power efficient manner?
  • 47. Managing display power efficiently 1. Full wakelocks keep your screen from turning off. To keep the display lit when your app is in the foreground, use FLAG_KEEP_SCREEN_ON 2. There is a direct correlation between screen brightness and power consumption 3. Offer a dark theme option. Gray or black backgrounds consume less than half the power of a white background Source: Qualcomm average power measurements using a Monsoon Power Monitor of the Google New & Weather app on a Samsung Galaxy Note 3 with the display at 50% screen brightness Source: Qualcomm tests of Nexus 6 average power consumption using a Monsoon Power monitor
  • 48. Does your app use all available system resources?
  • 49. Some apps don’t use resources efficiently Source: Trepn Profiler 5.0 screenshots
  • 50. Is your app CPU bound or GPU bound? Source: Trepn Profiler 5.0 screenshots
  • 51. Does it use all available CPU cores? Source: Trepn Profiler 5.0 screenshots
  • 52. Heterogeneous computing is key Run the right task on the right processing engine Source: Qualcomm internal power tests using QEPM software eQualcomm SeeMore demo using the MARE SDK a product of Qualcomm Technologies, Inc.
  • 53. Qualcomm Multicore Asynchronous Runtime Environment MARE is a developer programming library, API and runtime system for heterogeneous programming
  • 54. How to save power by offloading to DSP
  • 55. Benefits of offloading to DSP • Extends music playback time to 60 hours. A 50% increase. • When batching sensor data, 8 hours of sleep tracking only uses 10 to 20% of available battery life • Running FastCV™ facial detection on DSP instead of the CPU uses 32% less power 1. Audio playback done using a Nexus 5 using Bluetooth headphones and the display off. 2. Sensor batching done on Samsung Gear Live with Sleep as Android app 3. Power measured at the device battery. Source: Qualcomm Technologies Inc. internal measurements
  • 56. Does your app take too many GPS fixes?
  • 57. How to save power when using the GPS 1. Make sure you don’t take a GPS fix when it’s not needed 2. Use coarse GPS fixes when possible, because they require less power 3. Let LocationManager find the best provider 4. Have a timeout if you can’t find a satellite 5. Disable GPS when your app sleeps to save power 6. Make it easy for users to disable location tracking without crippling their device Source: Android 5.0 Location Settings on Samsung device
  • 58. Perf Matters Too! Use tools like these to confirm your perf hasn’t changed •ARM Streamline, GameBench, Adreno Profiler, Trepn Profiler, PerfMon, Intel INDE or Qualcomm® Snapdragon™ Profiler Real-time or post-capture viewing and analysis of a wide range of system and app level power, performance, thermal and network usage metrics Coming Soon: Snapdragon Profiler Qualcomm Snapdragon and Qualcomm Adreno are products of Qualcomm Technologies, Inc.
  • 59. Recap of power saving tips • Use wakelocks only when necessary • Close TCP sockets when done. Otherwise, you unnecessarily bring up the network just to tear down. This simple fix can reduce network power up to 20% • Group network activity when possible • Keep performance headroom for additional power savings. Saves significantly in overall system power. - Optimize your app to run at 60fps, but then frame-rate limit it to lower rate (ideally 30fps). This cuts GPU, CPU and memory utilization and hence related power by 50%. Also guarantees smooth consistent UX flow at same framerate • Avoid rendering at full native display resolutions. This saves GPU power. - Test rendering applications at lower resolutions - Games should ideally render at 1080p or lower resolutions natively
  • 61. Helpful mobile power-related links • Software power measurement best practices – Rick Schwartz • Hardware power measurement best practices – Rick Schwartz • Battery Drain and Networking – Colt McAnlis • What These Apps Did May Shock You - Doug Sillars • Understanding Battery Drain on Android – Colt McAnlis • How to power profile an app using hardware – Rick Schwartz • Battery Drain and WakeLocks – Colt McAnlis • AT&T Application Resource Optimizer demo - Doug Sillars • Monsoon Power Monitor - Tips & Tricks – Rick Schwartz