Battery Optimization:
Android Apps
With Best Practices for Zero Compromise on
Performance
JOB Scheduler API
✓ For efficient use of android resources and smartly handles background
tasks in a manner to improve battery life also.
✓ As it operates at the system level hence capable of smartly scheduling
background task to run along with jobs from other apps hence minimizes
radio usage a major battery drainage issue.
✓ It doesn’t perform task based on time but based on condition.
JOB Scheduler API
JOB Scheduler API Code Snippet
Android Doze
✓ When smartphone is kept idle for hours usually during night with screen
off and the device is stationary, this might drain some battery.
✓ Now android doze is triggered and it will defer the background tasks,
syncs, alarms and Wi-Fi scan until a maintenance window is scheduled.
✓ Doze will batch all background activities inside a single batch to extend
battery life by good margin.
Android Doze
Android Doze Extended
✓ When device is in pocket (not stationary) with screen off.
✓ the lighter doze version will be active and restrict lesser number of
background tasks.
✓ During this time there will be regular maintenance windows.
Android Doze Extended
Doze Modes Comparison
Extended doze mode produce maintenance window at short interval to ensure
apps are ready when user wants to use the device again.
Doze Optimization
✓ High Priority GSM messages are
the best method to deliver the
time critical messages to the
app. It enables app to access
the network to ensure
important notifications reach
the user
✓ Foreground services will
continue to work despite the
ongoing battery optimization.
Doze Optimization
Whether the smartphone is stationary or not, when the screen is off for a while
means user isn’t engaged with the device and that is an opportunity to
conserve the battery power.
App Standby
App Standby is designed to limit the background syncs and tasks for apps that
user isn’t interested at the moment.
App Standby
It is good practise to notice battery level and charging state before performing
application update. If the device is charging over AC(wall charger) refresh rate
can be maximised without affecting battery life. In case device is unplugged
limiting the update rate will help in maximising battery life.
Monitoring the Battery Level and Charging
State
Monitoring the Battery Level and Charging
State
Code Snippet to determine Charging State
and Method
// Are we charging / charged?
int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
status == BatteryManager.BATTERY_STATUS_FULL;
// How are we charging?
int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
boolean usbCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB;
boolean acCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC;
Monitor Connectivity State to Limit Battery
Drain
✓ Background services schedule updates to an application. They do it on
behalf of internet resources and cache data.
✓ This schedule can negatively impact battery life takes place especially
during no internet state or weak internet connection.
✓ You can handle this tricky situation smartly by knowing the device
connectivity status with connectivity manager
Monitor Connectivity State to Limit Battery
Drain
Connectivity manager will also help in decoding the connection category and
accordingly you can decide either to continue with an update to the application
or restrict it now.
Connectivity manager code snippet to query the active network and
subsequent internet connectivity.
ConnectivityManager cm =
(ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null &&
activeNetwork.isConnectedOrConnecting();
Key Steps required to Minimize Server
Updates and Optimize the Battery Drain
An Android application needs to activate the wireless radio and
create the connection to check the available updates on the
server. This will cause unnecessary battery drain.
Once we understand the device state, network connectivity and
user behavior then accordingly periodic update can be
scheduled.
Key Steps to Minimize Server Updates and
Optimize the Battery Drain
Key Steps required to Minimize Server
Updates and Optimize the Battery Drain
Google Cloud Messaging: A mobile notification service via
which server will notify the application when data is available
for download. All apps which require periodic updates from a
remote server can utilise this service which ensure update
notifications to the app are carried out using single GCM
connection. This approach will reduce unnecessary
connections to check for periodic updates as a new
connection is created only when an update is available
Key Steps to Minimize Server Updates and
Optimize the Battery Drain
Set the frequency to minimum: Another way to optimize is to
set the update frequency as low as possible at the same time
ensuring zero negative impact on user experience. This will
make the best balance between battery usage and data
updates.
Inexact Repeating Alarms: If multiple alarms are set to go off
around the same time then android can phase shift the alarm
fire time for various application in a manner that all these
apps will receive the alarm at the same time. This will allow all
applications to perform network updates with a single
Key Steps to Minimize Server Updates and
Optimize the Battery Drain
activation of wireless radio.
Exponential back-off methods: In this method updates are
scheduled after close monitoring the app usage and reduce
update frequency dynamically, generally frequency is reduced
for the apps which have not been used after the last update.
HTTP Cache and HTTP Response Cache: This technique is used
to avoid downloading duplicate files by keeping them in case.
Such files once stored inside case directory thereby,
eliminating the need to download it every time
Android Battery optimization Android Apps

More Related Content

PPTX
Android Device Hardening
PPTX
Weatherapp presentation-file
PPTX
IPL-16 project
PPTX
Seminar ppt fog comp
PDF
Mobile Security
PPTX
Drowsiness detection ppt
PPTX
Security in an embedded system
PDF
Edge computing
Android Device Hardening
Weatherapp presentation-file
IPL-16 project
Seminar ppt fog comp
Mobile Security
Drowsiness detection ppt
Security in an embedded system
Edge computing

What's hot (20)

PPT
Spyware
POTX
Rover Technology
PPTX
Data Center Networks
PDF
PPTX
Google App Engine
PDF
Seminar report on cloud computing
PPT
Weather Display app
PPTX
IoT Based Disaster Detection and Early Warning Device By Shweta Gaikwad
PPTX
Android security
PPTX
Weather now
PPTX
Security in embedded systems
PPTX
Mind reading computer ppt
PPT
Keyloggers.ppt
PPTX
Eucalyptus, Nimbus & OpenNebula
PPTX
Presentation on IoT Based Home Automation using android & NodeMCU
PDF
seminar report on wireless Sensor network
PPT
Cloud computing ppt
PPTX
Smart Irrigation System
PPTX
Calculator.ppt Andriod Application topic
DOCX
Home automation System (Acknowledgement and Preface Only)
Spyware
Rover Technology
Data Center Networks
Google App Engine
Seminar report on cloud computing
Weather Display app
IoT Based Disaster Detection and Early Warning Device By Shweta Gaikwad
Android security
Weather now
Security in embedded systems
Mind reading computer ppt
Keyloggers.ppt
Eucalyptus, Nimbus & OpenNebula
Presentation on IoT Based Home Automation using android & NodeMCU
seminar report on wireless Sensor network
Cloud computing ppt
Smart Irrigation System
Calculator.ppt Andriod Application topic
Home automation System (Acknowledgement and Preface Only)
Ad

Similar to Android Battery optimization Android Apps (20)

PPTX
gcce-uapm-slide-20131001-1900
PDF
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
PDF
How to Lower Android Power Consumption Without Affecting Performance
PPTX
How to Optimize Your App for Android and iOS Performance.pptx
PDF
Doug Sillars on App Optimization
PPT
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
PPTX
How to Optimize Your App for Android and iOS Performance
PDF
A Complete Step-by-Step Guide to Mobile App Performance Testing.pdf
PPT
Head into the Mobile App Maintenance for flawless performance
PDF
A Guide to Mastering Battery Drain Testing.pdf
PDF
Improve App Performance: Key Tips Explained
PDF
Mobile Performance Testing Approaches and Challenges
PDF
Mastering Flutter Performance: A Guide for Australian Apps
PDF
synopsis
PPTX
RL Battery saver
PDF
GREEN PAUWARE - For a power-thrifty mobile app marketplace
PDF
APE-Annotation Programming For Energy Eciency in Android
PDF
Android performance optimization_guide_h1 2016
PDF
A Guide on Automated Mobile App Performance Testing and Optimization.pdf
PPT
Londroid Android Home Screen Widgets
gcce-uapm-slide-20131001-1900
[TTT Meetup] Enhance mobile app testing with performance-centric strategies (...
How to Lower Android Power Consumption Without Affecting Performance
How to Optimize Your App for Android and iOS Performance.pptx
Doug Sillars on App Optimization
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
How to Optimize Your App for Android and iOS Performance
A Complete Step-by-Step Guide to Mobile App Performance Testing.pdf
Head into the Mobile App Maintenance for flawless performance
A Guide to Mastering Battery Drain Testing.pdf
Improve App Performance: Key Tips Explained
Mobile Performance Testing Approaches and Challenges
Mastering Flutter Performance: A Guide for Australian Apps
synopsis
RL Battery saver
GREEN PAUWARE - For a power-thrifty mobile app marketplace
APE-Annotation Programming For Energy Eciency in Android
Android performance optimization_guide_h1 2016
A Guide on Automated Mobile App Performance Testing and Optimization.pdf
Londroid Android Home Screen Widgets
Ad

More from Singsys Pte Ltd (20)

PPTX
Technical Seminar Series: GIT Pull Requests Best Practices
PPTX
Laravel Security Standards
PPTX
Android OS - The Journey of most popular Operating System
PPTX
How to do Memory Optimizations in Android
PPTX
iOS Application Battery Optimization Techniques
PPTX
How to Create WordPress Website in Easy Steps
PPTX
Basics of-linux
PPTX
PPTX
Introduction to facebook sdk
PPTX
Html5 tutorial for beginners
PPTX
Beginners css tutorial for web designers
PPT
Joomla 3 installation and management guide
PPT
Joomla Introduction & Installation Tutorial
PPTX
Basic of web design
PPTX
Embedded Technology
PPT
Java Tutorial
PPTX
Technical seo tips for web developers
PPTX
WordPress Website Design and Development
PPTX
Being a designer
PPT
Points for Design and Development of SEO friendly websites
Technical Seminar Series: GIT Pull Requests Best Practices
Laravel Security Standards
Android OS - The Journey of most popular Operating System
How to do Memory Optimizations in Android
iOS Application Battery Optimization Techniques
How to Create WordPress Website in Easy Steps
Basics of-linux
Introduction to facebook sdk
Html5 tutorial for beginners
Beginners css tutorial for web designers
Joomla 3 installation and management guide
Joomla Introduction & Installation Tutorial
Basic of web design
Embedded Technology
Java Tutorial
Technical seo tips for web developers
WordPress Website Design and Development
Being a designer
Points for Design and Development of SEO friendly websites

Recently uploaded (20)

PDF
State of AI in Business 2025 - MIT NANDA
PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
TicketRoot: Event Tech Solutions Deck 2025
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
substrate PowerPoint Presentation basic one
PPTX
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
PDF
Internet of Things (IoT) – Definition, Types, and Uses
PPTX
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PDF
Secure Java Applications against Quantum Threats
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PDF
Streamline Vulnerability Management From Minimal Images to SBOMs
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
PDF
Altius execution marketplace concept.pdf
PPTX
How to use fields_get method in Odoo 18
PDF
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...
State of AI in Business 2025 - MIT NANDA
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
TicketRoot: Event Tech Solutions Deck 2025
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Build automations faster and more reliably with UiPath ScreenPlay
substrate PowerPoint Presentation basic one
Strategic Picks — Prioritising the Right Agentic Use Cases [2/6]
Internet of Things (IoT) – Definition, Types, and Uses
From Curiosity to ROI — Cost-Benefit Analysis of Agentic Automation [3/6]
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
NewMind AI Journal Monthly Chronicles - August 2025
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
Secure Java Applications against Quantum Threats
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Streamline Vulnerability Management From Minimal Images to SBOMs
Child-friendly e-learning for artificial intelligence education in Indonesia:...
Altius execution marketplace concept.pdf
How to use fields_get method in Odoo 18
GDG Cloud Southlake #45: Patrick Debois: The Impact of GenAI on Development a...

Android Battery optimization Android Apps

  • 1. Battery Optimization: Android Apps With Best Practices for Zero Compromise on Performance
  • 2. JOB Scheduler API ✓ For efficient use of android resources and smartly handles background tasks in a manner to improve battery life also. ✓ As it operates at the system level hence capable of smartly scheduling background task to run along with jobs from other apps hence minimizes radio usage a major battery drainage issue. ✓ It doesn’t perform task based on time but based on condition.
  • 4. JOB Scheduler API Code Snippet
  • 5. Android Doze ✓ When smartphone is kept idle for hours usually during night with screen off and the device is stationary, this might drain some battery. ✓ Now android doze is triggered and it will defer the background tasks, syncs, alarms and Wi-Fi scan until a maintenance window is scheduled. ✓ Doze will batch all background activities inside a single batch to extend battery life by good margin.
  • 7. Android Doze Extended ✓ When device is in pocket (not stationary) with screen off. ✓ the lighter doze version will be active and restrict lesser number of background tasks. ✓ During this time there will be regular maintenance windows.
  • 9. Doze Modes Comparison Extended doze mode produce maintenance window at short interval to ensure apps are ready when user wants to use the device again.
  • 10. Doze Optimization ✓ High Priority GSM messages are the best method to deliver the time critical messages to the app. It enables app to access the network to ensure important notifications reach the user ✓ Foreground services will continue to work despite the ongoing battery optimization.
  • 11. Doze Optimization Whether the smartphone is stationary or not, when the screen is off for a while means user isn’t engaged with the device and that is an opportunity to conserve the battery power.
  • 12. App Standby App Standby is designed to limit the background syncs and tasks for apps that user isn’t interested at the moment.
  • 14. It is good practise to notice battery level and charging state before performing application update. If the device is charging over AC(wall charger) refresh rate can be maximised without affecting battery life. In case device is unplugged limiting the update rate will help in maximising battery life. Monitoring the Battery Level and Charging State
  • 15. Monitoring the Battery Level and Charging State
  • 16. Code Snippet to determine Charging State and Method // Are we charging / charged? int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL; // How are we charging? int chargePlug = batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); boolean usbCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_USB; boolean acCharge = chargePlug == BatteryManager.BATTERY_PLUGGED_AC;
  • 17. Monitor Connectivity State to Limit Battery Drain ✓ Background services schedule updates to an application. They do it on behalf of internet resources and cache data. ✓ This schedule can negatively impact battery life takes place especially during no internet state or weak internet connection. ✓ You can handle this tricky situation smartly by knowing the device connectivity status with connectivity manager
  • 18. Monitor Connectivity State to Limit Battery Drain Connectivity manager will also help in decoding the connection category and accordingly you can decide either to continue with an update to the application or restrict it now. Connectivity manager code snippet to query the active network and subsequent internet connectivity. ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();
  • 19. Key Steps required to Minimize Server Updates and Optimize the Battery Drain An Android application needs to activate the wireless radio and create the connection to check the available updates on the server. This will cause unnecessary battery drain. Once we understand the device state, network connectivity and user behavior then accordingly periodic update can be scheduled.
  • 20. Key Steps to Minimize Server Updates and Optimize the Battery Drain
  • 21. Key Steps required to Minimize Server Updates and Optimize the Battery Drain Google Cloud Messaging: A mobile notification service via which server will notify the application when data is available for download. All apps which require periodic updates from a remote server can utilise this service which ensure update notifications to the app are carried out using single GCM connection. This approach will reduce unnecessary connections to check for periodic updates as a new connection is created only when an update is available
  • 22. Key Steps to Minimize Server Updates and Optimize the Battery Drain Set the frequency to minimum: Another way to optimize is to set the update frequency as low as possible at the same time ensuring zero negative impact on user experience. This will make the best balance between battery usage and data updates. Inexact Repeating Alarms: If multiple alarms are set to go off around the same time then android can phase shift the alarm fire time for various application in a manner that all these apps will receive the alarm at the same time. This will allow all applications to perform network updates with a single
  • 23. Key Steps to Minimize Server Updates and Optimize the Battery Drain activation of wireless radio. Exponential back-off methods: In this method updates are scheduled after close monitoring the app usage and reduce update frequency dynamically, generally frequency is reduced for the apps which have not been used after the last update. HTTP Cache and HTTP Response Cache: This technique is used to avoid downloading duplicate files by keeping them in case. Such files once stored inside case directory thereby, eliminating the need to download it every time