SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
android battery
consumption
the what & how
kumar rangarajan
introducing
littleEye appInsight
CT scanner for your Android App
•#1 pain point of smart phones users.
• more visible on Android than in iOS
• unlike memory, you can never reclaim excess usage!
• no moore’s law for battery capacity
• improving battery capacity is an ongoing research
activity, but no current solution
• even then keeping up with consumption would be
difficult as apps get more powerful and resource
hungry
why should you care about battery
consumption?
Bad battery life is a big
problem for
‣ Users
‣ Developers
‣ Ad networks
‣ Smartphone manufacturers
we code... consumers suffer
• #1 pain point of smart phones users.
•more visible on Android world than in iOS
• unlike memory, you can never reclaim excess usage!
• no moore’s law for battery capacity
• improving battery capacity is an ongoing research
activity, but no current solution
• even then keeping up with consumption would be
difficult as apps get more powerful and resource
hungry
why should you care about battery
consumption?
• #1 pain point of smart phones users.
• more visible on Android world than in iOS
•unlike memory, you can never reclaim excess
usage!
• no moore’s law for battery capacity
• improving battery capacity is an ongoing research activity,
but no current solution
• even then keeping up with consumption would be
why should you care about battery
consumption?
• #1 pain point of smart phones users.
• more visible on Android world than in iOS
• unlike memory, you can never reclaim excess usage!
•no moore’s law for battery capacity
• improving battery capacity is an ongoing research activity,
but no current solution
• even then keeping up with consumption would be
difficult as apps get more powerful and resource hungry
why should you care about battery
consumption?
• #1 pain point of smart phones users.
• more visible on Android world than in iOS
• unlike memory, you can never reclaim excess usage!
• no moore’s law for battery capacity
•improving battery capacity is an ongoing
research activity, but no current solution
• even then keeping up with consumption would be
difficult as apps get more powerful and resource hungry
why should you care about battery
consumption?
why should you care about battery
consumption?
• #1 pain point of smart phones users.
• more visible on Android world than in iOS
• unlike memory, you can never reclaim excess usage!
• no moore’s law for battery capacity
• improving battery capacity is an ongoing research activity,
but no current solution
•even then keeping up with consumption
would be difficult as apps will get more
powerful and resource hungry
what consumes power?
originally published in Google IO by Jeff Sharkey
network activity
• EDGE consumes less power for a byte of data transfer,
but is slow
• Wifi consumes more power on average, but can do
job faster
• 3G consumes more power than Wifi, and typically
slower than Wifi.
• 4G consumes more power than 3G, and depending on
availability, faster than Wifi
4G > 3G > Wifi > 2G
what causes power consumption?
• four primary states -
‣ establishing connection or association
‣ maintaining association (idle)
‣ transmission (two or more sub states)
‣ tail state (pseudo state)
Establish Maintain Transmit Tail
Wifi High Low Low Low
2G Low Low Low Low
3G Low Low High High
derived from http://people.cs.umass.edu/~arun/papers/TailEnder.pdf
more about states
time between state reduction = tail state
how apps can impact state
number of
data
operations
duration
between
operations
size of each
operation
time in high/
low state
app1 3 18 1 mb/s
18 + 42
seconds
app2 3 0 (bundled) 1 mb/s
8 + 12
seconds
relative power consumption
Total Current Consumed for 1 minute
app1 78mA
app2 28mA
app1 consumes 3x app2
• prefetch data
‣ to avoid switching states frequently, try and read as much data as
possible
‣ trade-off between too much pre-fetch and battery drain
‣ google recommends prefetching data that you will initiate in the
next 2 to 5 minutes, and in the order of 1-5 MB size
• batch data
‣ do data send/receive in batches rather than on-demand
‣ eg: batch analytics information, rather than sending them as they
are collected
best practices for network
• prefetch data
‣ to avoid switching states frequently, try and read as much data as
possible
‣ trade-off between too much pre-fetch and battery drain
‣ google recommends prefetching data that you will initiate in the
next 2 to 5 minutes, and in the order of 1-5 MB size
• batch data
‣ do data send/receive in batches rather than on-demand
‣ eg: batch analytics information, rather than sending them as they
are collected
best practices for network
• detect network connection
‣ avoid connection attempts if no network is active
• avoid polling and use GCM when possible
‣ avoids multiple connections
‣ reduces the number of device state changes
• using inexact timers
‣ AlarmManager.setInexactRepeating()
‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP
best practices for network
• detect network connection
‣ avoid connection attempts if no network is active
• avoid polling and use GCM when possible
‣ avoids multiple connections
‣ reduces the number of device state changes
• using inexact timers
‣ AlarmManager.setInexactRepeating()
‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP
best practices for network
• detect network connection
‣ avoid connection attempts if no network is active
• avoid polling and use GCM when possible
‣ avoids multiple connections
‣ reduces the number of device state changes
• using inexact timers
‣ AlarmManager.setInexactRepeating()
‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP
best practices for network
• use caching
‣ avoid redundant downloads
• varying download pattern
‣ modify pattern based on connection type
‣ download more data per session on faster
networks
❖ change the aggression of pre-fetch
best practices for network
• use caching
‣ avoid redundant downloads
• varying download pattern
‣ modify pattern based on connection type
‣ download more data per session on faster
networks
❖ change the aggression of pre-fetch
best practices for network
• monitor charge level and state
• monitor and determine the docking state
and type
• monitor the connectivity state
• manipulate broadcast receivers on-demand
other tips (from google)
• monitor charge level and state
• monitor and determine the docking state
and type
• monitor the connectivity state
• manipulate broadcast receivers on-demand
other tips (from google)
• monitor charge level and state
• monitor and determine the docking state
and type
• monitor the connectivity state
• manipulate broadcast receivers on-demand
other tips (from google)
• monitor charge level and state
• monitor and determine the docking state
and type
• monitor the connectivity state
• manipulate broadcast receivers on-demand
other tips (from google)
if your audience has not gone
to sleep yet
&
organizers have...
screen
• color matters!
‣ esp on OLED screens
• darker the color, lesser the
consumption
• brightness levels have more
impact
‣ refer to - http://stackoverflow.com/
questions/5032588/cant-apply-system-
screen-brightness-programmatically-in-
android
‣ programmatically reduce brightness if
its suits your app/activity
Chameleon: Color Transformation on OLED Displays
screen
• color matters!
‣ esp on OLED screens
• darker the color, lesser the
consumption
• brightness levels have more
impact
‣ refer to - http://stackoverflow.com/
questions/5032588/cant-apply-system-
screen-brightness-programmatically-in-
android
‣ programmatically reduce brightness if
its suits your app/activity
Chameleon: Color Transformation on OLED Displays
screen
• color matters!
‣ esp on OLED screens
• darker the color, lesser the
consumption
• brightness levels have more
impact
‣ refer to - http://stackoverflow.com/
questions/5032588/cant-apply-system-
screen-brightness-programmatically-in-
android
‣ programmatically reduce brightness if
its suits your app/activity
Chameleon: Color Transformation on OLED Displays
cpu
• typically runs on various
frequencies
• frequency transition controlled
by governor policy installed
• same concept as on linux based
PCs, but typically more
aggressive
• system drops down to ‘deep
sleep’ as much as it can
• frequencies are scaled based of
usage (C) CPUspy
cpu
• typically runs on various
frequencies
• frequency transition controlled
by governor policy installed
• same concept as on linux based
PCs, but typically more
aggressive
• system drops down to ‘deep
sleep’ as much as it can
• frequencies are scaled based of
usage (C) CPUspy
cpu
• typically runs on various
frequencies
• frequency transition controlled
by governor policy installed
• same concept as on linux based
PCs, but typically more
aggressive
• system drops down to ‘deep
sleep’ as much as it can
• frequencies are scaled based of
usage (C) CPUspy
cpu
• typically runs on various
frequencies
• frequency transition controlled
by governor policy installed
• same concept as on linux based
PCs, but typically more
aggressive
• system drops down to ‘deep
sleep’ as much as it can
• frequencies are scaled based of
usage (C) CPUspy
cpu
• typically runs on various
frequencies
• frequency transition controlled
by governor policy installed
• same concept as on linux based
PCs, but typically more
aggressive
• system drops down to ‘deep
sleep’ as much as it can
• frequencies are scaled based of
usage (C) CPUspy
• wakelocks are your friend, but your users
worst nightmare!
• use them only if really needed and ensure
they are removed as soon as possible
• use ‘android:keepScreenOn’ property in your
manifest instead of doing it programmatically
• if possible, spread out your computationally
intensive job
best practices for cpu
• wakelocks are your friend, but your users
worst nightmare!
• use them only if really needed and ensure
they are removed as soon as possible
• use ‘android:keepScreenOn’ property in your
manifest instead of doing it programmatically
• if possible, spread out your computationally
intensive job
best practices for cpu
• wakelocks are your friend, but your users
worst nightmare!
• use them only if really needed and ensure
they are removed as soon as possible
• use ‘android:keepScreenOn’ property in your
manifest instead of doing it programmatically
• if possible, spread out your computationally
intensive job
best practices for cpu
• wakelocks are your friend, but your users
worst nightmare!
• use them only if really needed and ensure
they are removed as soon as possible
• use ‘android:keepScreenOn’ property in your
manifest instead of doing it programmatically
• if possible, spread out your computationally
intensive job
best practices for cpu
• gpu typically consumes more power than cpu
‣ avoid floating point math where possible
• use gpu for data-parallel tasks like video/image
processing
• use algorithms that consume less CPU cycle
‣ O(n log n) vs O(n 2) algorithms
goal - keep the freq to the lowest
level or reduce the number of cycles
best practices for cpu
• gpu typically consumes more power than cpu
‣ avoid floating point math where possible
• use gpu for data-parallel tasks like video/image
processing
• use algorithms that consume less CPU cycle
‣ O(n log n) vs O(n 2) algorithms
goal - keep the freq to the lowest
level or reduce the number of cycles
best practices for cpu
• gpu typically consumes more power than cpu
‣ avoid floating point math where possible
• use gpu for data-parallel tasks like video/image
processing
• use algorithms that consume less CPU cycle
‣ O(n log n) vs O(n 2) algorithms
goal - keep the freq to the lowest
level or reduce the number of cycles
best practices for cpu
•gps is another very expensive component
‣ avoid fine grained locations if possible
•use power efficient SDKs
‣ eg: Location SDK from SkyhookWireless
best practices (others)
•gps is another very expensive component
‣ avoid fine grained locations if possible
•use power efficient SDKs
‣ eg: Location SDK from SkyhookWireless
best practices (others)
references
1. http://developer.android.com/training/efficient-downloads/index.html
2. http://developer.android.com/training/monitoring-device-state/
index.html
3. http://dl.google.com/io/2009/pres/W_0300_CodingforLife-
BatteryLifeThatIs.pdf
4. http://people.cs.umass.edu/~arun/papers/TailEnder.pdf
5. http://chipdesignmag.com/lpd/absolute-power/2012/05/10/4g-lte-vs-3g/
6. http://thisweekinbatteries.blogspot.in/
7. http://www.ruf.rice.edu/~mobile/publications/dong10chameleon-
demo.pdf
thank you
this presentation has been shared @
http://www.slideshare.net/littleeye/power-optimization-for-android-developers
http://www.littleeye.co/blog
kumar@littleeye.co

Contenu connexe

Dernier

9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 

Dernier (8)

9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Power optimization of android device

  • 1. android battery consumption the what & how kumar rangarajan
  • 3. •#1 pain point of smart phones users. • more visible on Android than in iOS • unlike memory, you can never reclaim excess usage! • no moore’s law for battery capacity • improving battery capacity is an ongoing research activity, but no current solution • even then keeping up with consumption would be difficult as apps get more powerful and resource hungry why should you care about battery consumption?
  • 4. Bad battery life is a big problem for ‣ Users ‣ Developers ‣ Ad networks ‣ Smartphone manufacturers we code... consumers suffer
  • 5. • #1 pain point of smart phones users. •more visible on Android world than in iOS • unlike memory, you can never reclaim excess usage! • no moore’s law for battery capacity • improving battery capacity is an ongoing research activity, but no current solution • even then keeping up with consumption would be difficult as apps get more powerful and resource hungry why should you care about battery consumption?
  • 6. • #1 pain point of smart phones users. • more visible on Android world than in iOS •unlike memory, you can never reclaim excess usage! • no moore’s law for battery capacity • improving battery capacity is an ongoing research activity, but no current solution • even then keeping up with consumption would be why should you care about battery consumption?
  • 7. • #1 pain point of smart phones users. • more visible on Android world than in iOS • unlike memory, you can never reclaim excess usage! •no moore’s law for battery capacity • improving battery capacity is an ongoing research activity, but no current solution • even then keeping up with consumption would be difficult as apps get more powerful and resource hungry why should you care about battery consumption?
  • 8. • #1 pain point of smart phones users. • more visible on Android world than in iOS • unlike memory, you can never reclaim excess usage! • no moore’s law for battery capacity •improving battery capacity is an ongoing research activity, but no current solution • even then keeping up with consumption would be difficult as apps get more powerful and resource hungry why should you care about battery consumption?
  • 9. why should you care about battery consumption? • #1 pain point of smart phones users. • more visible on Android world than in iOS • unlike memory, you can never reclaim excess usage! • no moore’s law for battery capacity • improving battery capacity is an ongoing research activity, but no current solution •even then keeping up with consumption would be difficult as apps will get more powerful and resource hungry
  • 10. what consumes power? originally published in Google IO by Jeff Sharkey
  • 11. network activity • EDGE consumes less power for a byte of data transfer, but is slow • Wifi consumes more power on average, but can do job faster • 3G consumes more power than Wifi, and typically slower than Wifi. • 4G consumes more power than 3G, and depending on availability, faster than Wifi 4G > 3G > Wifi > 2G
  • 12. what causes power consumption? • four primary states - ‣ establishing connection or association ‣ maintaining association (idle) ‣ transmission (two or more sub states) ‣ tail state (pseudo state) Establish Maintain Transmit Tail Wifi High Low Low Low 2G Low Low Low Low 3G Low Low High High derived from http://people.cs.umass.edu/~arun/papers/TailEnder.pdf
  • 13. more about states time between state reduction = tail state
  • 14. how apps can impact state number of data operations duration between operations size of each operation time in high/ low state app1 3 18 1 mb/s 18 + 42 seconds app2 3 0 (bundled) 1 mb/s 8 + 12 seconds
  • 15. relative power consumption Total Current Consumed for 1 minute app1 78mA app2 28mA app1 consumes 3x app2
  • 16. • prefetch data ‣ to avoid switching states frequently, try and read as much data as possible ‣ trade-off between too much pre-fetch and battery drain ‣ google recommends prefetching data that you will initiate in the next 2 to 5 minutes, and in the order of 1-5 MB size • batch data ‣ do data send/receive in batches rather than on-demand ‣ eg: batch analytics information, rather than sending them as they are collected best practices for network
  • 17. • prefetch data ‣ to avoid switching states frequently, try and read as much data as possible ‣ trade-off between too much pre-fetch and battery drain ‣ google recommends prefetching data that you will initiate in the next 2 to 5 minutes, and in the order of 1-5 MB size • batch data ‣ do data send/receive in batches rather than on-demand ‣ eg: batch analytics information, rather than sending them as they are collected best practices for network
  • 18. • detect network connection ‣ avoid connection attempts if no network is active • avoid polling and use GCM when possible ‣ avoids multiple connections ‣ reduces the number of device state changes • using inexact timers ‣ AlarmManager.setInexactRepeating() ‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP best practices for network
  • 19. • detect network connection ‣ avoid connection attempts if no network is active • avoid polling and use GCM when possible ‣ avoids multiple connections ‣ reduces the number of device state changes • using inexact timers ‣ AlarmManager.setInexactRepeating() ‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP best practices for network
  • 20. • detect network connection ‣ avoid connection attempts if no network is active • avoid polling and use GCM when possible ‣ avoids multiple connections ‣ reduces the number of device state changes • using inexact timers ‣ AlarmManager.setInexactRepeating() ‣ use ELAPSED_REALTIME instead of ELAPED_REALTIME_WAKEUP best practices for network
  • 21. • use caching ‣ avoid redundant downloads • varying download pattern ‣ modify pattern based on connection type ‣ download more data per session on faster networks ❖ change the aggression of pre-fetch best practices for network
  • 22. • use caching ‣ avoid redundant downloads • varying download pattern ‣ modify pattern based on connection type ‣ download more data per session on faster networks ❖ change the aggression of pre-fetch best practices for network
  • 23. • monitor charge level and state • monitor and determine the docking state and type • monitor the connectivity state • manipulate broadcast receivers on-demand other tips (from google)
  • 24. • monitor charge level and state • monitor and determine the docking state and type • monitor the connectivity state • manipulate broadcast receivers on-demand other tips (from google)
  • 25. • monitor charge level and state • monitor and determine the docking state and type • monitor the connectivity state • manipulate broadcast receivers on-demand other tips (from google)
  • 26. • monitor charge level and state • monitor and determine the docking state and type • monitor the connectivity state • manipulate broadcast receivers on-demand other tips (from google)
  • 27. if your audience has not gone to sleep yet & organizers have...
  • 28. screen • color matters! ‣ esp on OLED screens • darker the color, lesser the consumption • brightness levels have more impact ‣ refer to - http://stackoverflow.com/ questions/5032588/cant-apply-system- screen-brightness-programmatically-in- android ‣ programmatically reduce brightness if its suits your app/activity Chameleon: Color Transformation on OLED Displays
  • 29. screen • color matters! ‣ esp on OLED screens • darker the color, lesser the consumption • brightness levels have more impact ‣ refer to - http://stackoverflow.com/ questions/5032588/cant-apply-system- screen-brightness-programmatically-in- android ‣ programmatically reduce brightness if its suits your app/activity Chameleon: Color Transformation on OLED Displays
  • 30. screen • color matters! ‣ esp on OLED screens • darker the color, lesser the consumption • brightness levels have more impact ‣ refer to - http://stackoverflow.com/ questions/5032588/cant-apply-system- screen-brightness-programmatically-in- android ‣ programmatically reduce brightness if its suits your app/activity Chameleon: Color Transformation on OLED Displays
  • 31. cpu • typically runs on various frequencies • frequency transition controlled by governor policy installed • same concept as on linux based PCs, but typically more aggressive • system drops down to ‘deep sleep’ as much as it can • frequencies are scaled based of usage (C) CPUspy
  • 32. cpu • typically runs on various frequencies • frequency transition controlled by governor policy installed • same concept as on linux based PCs, but typically more aggressive • system drops down to ‘deep sleep’ as much as it can • frequencies are scaled based of usage (C) CPUspy
  • 33. cpu • typically runs on various frequencies • frequency transition controlled by governor policy installed • same concept as on linux based PCs, but typically more aggressive • system drops down to ‘deep sleep’ as much as it can • frequencies are scaled based of usage (C) CPUspy
  • 34. cpu • typically runs on various frequencies • frequency transition controlled by governor policy installed • same concept as on linux based PCs, but typically more aggressive • system drops down to ‘deep sleep’ as much as it can • frequencies are scaled based of usage (C) CPUspy
  • 35. cpu • typically runs on various frequencies • frequency transition controlled by governor policy installed • same concept as on linux based PCs, but typically more aggressive • system drops down to ‘deep sleep’ as much as it can • frequencies are scaled based of usage (C) CPUspy
  • 36. • wakelocks are your friend, but your users worst nightmare! • use them only if really needed and ensure they are removed as soon as possible • use ‘android:keepScreenOn’ property in your manifest instead of doing it programmatically • if possible, spread out your computationally intensive job best practices for cpu
  • 37. • wakelocks are your friend, but your users worst nightmare! • use them only if really needed and ensure they are removed as soon as possible • use ‘android:keepScreenOn’ property in your manifest instead of doing it programmatically • if possible, spread out your computationally intensive job best practices for cpu
  • 38. • wakelocks are your friend, but your users worst nightmare! • use them only if really needed and ensure they are removed as soon as possible • use ‘android:keepScreenOn’ property in your manifest instead of doing it programmatically • if possible, spread out your computationally intensive job best practices for cpu
  • 39. • wakelocks are your friend, but your users worst nightmare! • use them only if really needed and ensure they are removed as soon as possible • use ‘android:keepScreenOn’ property in your manifest instead of doing it programmatically • if possible, spread out your computationally intensive job best practices for cpu
  • 40. • gpu typically consumes more power than cpu ‣ avoid floating point math where possible • use gpu for data-parallel tasks like video/image processing • use algorithms that consume less CPU cycle ‣ O(n log n) vs O(n 2) algorithms goal - keep the freq to the lowest level or reduce the number of cycles best practices for cpu
  • 41. • gpu typically consumes more power than cpu ‣ avoid floating point math where possible • use gpu for data-parallel tasks like video/image processing • use algorithms that consume less CPU cycle ‣ O(n log n) vs O(n 2) algorithms goal - keep the freq to the lowest level or reduce the number of cycles best practices for cpu
  • 42. • gpu typically consumes more power than cpu ‣ avoid floating point math where possible • use gpu for data-parallel tasks like video/image processing • use algorithms that consume less CPU cycle ‣ O(n log n) vs O(n 2) algorithms goal - keep the freq to the lowest level or reduce the number of cycles best practices for cpu
  • 43. •gps is another very expensive component ‣ avoid fine grained locations if possible •use power efficient SDKs ‣ eg: Location SDK from SkyhookWireless best practices (others)
  • 44. •gps is another very expensive component ‣ avoid fine grained locations if possible •use power efficient SDKs ‣ eg: Location SDK from SkyhookWireless best practices (others)
  • 45. references 1. http://developer.android.com/training/efficient-downloads/index.html 2. http://developer.android.com/training/monitoring-device-state/ index.html 3. http://dl.google.com/io/2009/pres/W_0300_CodingforLife- BatteryLifeThatIs.pdf 4. http://people.cs.umass.edu/~arun/papers/TailEnder.pdf 5. http://chipdesignmag.com/lpd/absolute-power/2012/05/10/4g-lte-vs-3g/ 6. http://thisweekinbatteries.blogspot.in/ 7. http://www.ruf.rice.edu/~mobile/publications/dong10chameleon- demo.pdf
  • 46. thank you this presentation has been shared @ http://www.slideshare.net/littleeye/power-optimization-for-android-developers http://www.littleeye.co/blog kumar@littleeye.co