SlideShare une entreprise Scribd logo
1  sur  24
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

Contenu connexe

Tendances

Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminarshilpi nagpal
 
Synopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation SystemSynopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation SystemZainabNoorGul
 
SCREENLESS DISPLAY
SCREENLESS DISPLAYSCREENLESS DISPLAY
SCREENLESS DISPLAYMahad Mumtaz
 
Robocop final year project presentation by Abhimanyu Kumar
Robocop final year project presentation by Abhimanyu KumarRobocop final year project presentation by Abhimanyu Kumar
Robocop final year project presentation by Abhimanyu KumarAbhimanyu Kumar
 
Anti drowsy alarm for drivers
Anti drowsy alarm for driversAnti drowsy alarm for drivers
Anti drowsy alarm for driversDuc Nguyen Van
 
Rainbow technology-ppt
Rainbow technology-pptRainbow technology-ppt
Rainbow technology-pptRajesh Roky
 
Project titles with abstract php
Project titles with abstract phpProject titles with abstract php
Project titles with abstract phpSoftroniics india
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development pptsaitej15
 
Attendence management system using face detection
Attendence management system using face detectionAttendence management system using face detection
Attendence management system using face detectionSaurabh Sutone
 
Seminar on night vision technology ppt
Seminar on night vision technology pptSeminar on night vision technology ppt
Seminar on night vision technology pptdeepakmarndi
 
Silverlight
SilverlightSilverlight
SilverlightBiTWiSE
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.netSanket Jagare
 
Screenless Display PPT
Screenless Display PPTScreenless Display PPT
Screenless Display PPTVikas Kumar
 
Silent sound-technology ppt final
Silent sound-technology ppt finalSilent sound-technology ppt final
Silent sound-technology ppt finalLohit Dalal
 

Tendances (20)

An atm with an eye
An atm with an eyeAn atm with an eye
An atm with an eye
 
Best topics for seminar
Best topics for seminarBest topics for seminar
Best topics for seminar
 
Biometric Security Systems ppt
Biometric Security Systems pptBiometric Security Systems ppt
Biometric Security Systems ppt
 
Clockless chips
Clockless chipsClockless chips
Clockless chips
 
Synopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation SystemSynopsis for Online Railway Railway Reservation System
Synopsis for Online Railway Railway Reservation System
 
SCREENLESS DISPLAY
SCREENLESS DISPLAYSCREENLESS DISPLAY
SCREENLESS DISPLAY
 
Robocop final year project presentation by Abhimanyu Kumar
Robocop final year project presentation by Abhimanyu KumarRobocop final year project presentation by Abhimanyu Kumar
Robocop final year project presentation by Abhimanyu Kumar
 
BIO BATTERY
BIO BATTERY BIO BATTERY
BIO BATTERY
 
Anti drowsy alarm for drivers
Anti drowsy alarm for driversAnti drowsy alarm for drivers
Anti drowsy alarm for drivers
 
Rainbow technology-ppt
Rainbow technology-pptRainbow technology-ppt
Rainbow technology-ppt
 
Project titles with abstract php
Project titles with abstract phpProject titles with abstract php
Project titles with abstract php
 
Android app development ppt
Android app development pptAndroid app development ppt
Android app development ppt
 
Sign language recognizer
Sign language recognizerSign language recognizer
Sign language recognizer
 
Wireless charging ppt
Wireless charging pptWireless charging ppt
Wireless charging ppt
 
Attendence management system using face detection
Attendence management system using face detectionAttendence management system using face detection
Attendence management system using face detection
 
Seminar on night vision technology ppt
Seminar on night vision technology pptSeminar on night vision technology ppt
Seminar on night vision technology ppt
 
Silverlight
SilverlightSilverlight
Silverlight
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.net
 
Screenless Display PPT
Screenless Display PPTScreenless Display PPT
Screenless Display PPT
 
Silent sound-technology ppt final
Silent sound-technology ppt finalSilent sound-technology ppt final
Silent sound-technology ppt final
 

Similaire à Android Battery optimization Android Apps

[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
 
How to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting PerformanceHow to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting Performancerickschwar
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimizationwipjam
 
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.pptMobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.pptAchyu4
 
Head into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performanceHead into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performanceiMOBDEV Technologies Pvt. Ltd.
 
Mobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesMobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesNous Infosystems
 
RL Battery saver
RL Battery saverRL Battery saver
RL Battery saverRanjith G
 
GREEN PAUWARE - For a power-thrifty mobile app marketplace
GREEN PAUWARE - For a power-thrifty mobile app marketplaceGREEN PAUWARE - For a power-thrifty mobile app marketplace
GREEN PAUWARE - For a power-thrifty mobile app marketplaceOlivier Le Goaër
 
APE-Annotation Programming For Energy Eciency in Android
APE-Annotation Programming For Energy Eciency in AndroidAPE-Annotation Programming For Energy Eciency in Android
APE-Annotation Programming For Energy Eciency in Androidkaranwayne
 
Android performance optimization_guide_h1 2016
Android performance optimization_guide_h1 2016Android performance optimization_guide_h1 2016
Android performance optimization_guide_h1 2016AVG Technologies
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsRichard Hyndman
 
W 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisW 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisjicheng687
 
Delta++ Reducing The Size Of Android Application Updates
Delta++ Reducing The Size Of Android Application UpdatesDelta++ Reducing The Size Of Android Application Updates
Delta++ Reducing The Size Of Android Application UpdatesPapitha Velumani
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load testduke.kalra
 
Communication in android
Communication in androidCommunication in android
Communication in androideleksdev
 
Delta++ reducing the size of android application updates
Delta++ reducing the size of android application updatesDelta++ reducing the size of android application updates
Delta++ reducing the size of android application updatesJPINFOTECH JAYAPRAKASH
 
Abnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneAbnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneShivi Tandon
 

Similaire à Android Battery optimization Android Apps (20)

gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900
 
[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 (...
 
How to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting PerformanceHow to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting Performance
 
Doug Sillars on App Optimization
Doug Sillars on App OptimizationDoug Sillars on App Optimization
Doug Sillars on App Optimization
 
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.pptMobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
Mobile-Application-Development–-Lecture-Notes-on-UNIT-3.ppt
 
Head into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performanceHead into the Mobile App Maintenance for flawless performance
Head into the Mobile App Maintenance for flawless performance
 
Mobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and ChallengesMobile Performance Testing Approaches and Challenges
Mobile Performance Testing Approaches and Challenges
 
synopsis
synopsissynopsis
synopsis
 
RL Battery saver
RL Battery saverRL Battery saver
RL Battery saver
 
GREEN PAUWARE - For a power-thrifty mobile app marketplace
GREEN PAUWARE - For a power-thrifty mobile app marketplaceGREEN PAUWARE - For a power-thrifty mobile app marketplace
GREEN PAUWARE - For a power-thrifty mobile app marketplace
 
APE-Annotation Programming For Energy Eciency in Android
APE-Annotation Programming For Energy Eciency in AndroidAPE-Annotation Programming For Energy Eciency in Android
APE-Annotation Programming For Energy Eciency in Android
 
Android performance optimization_guide_h1 2016
Android performance optimization_guide_h1 2016Android performance optimization_guide_h1 2016
Android performance optimization_guide_h1 2016
 
Londroid Android Home Screen Widgets
Londroid Android Home Screen WidgetsLondroid Android Home Screen Widgets
Londroid Android Home Screen Widgets
 
W 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatisW 0300 codingfor_life-batterylifethatis
W 0300 codingfor_life-batterylifethatis
 
Delta++ Reducing The Size Of Android Application Updates
Delta++ Reducing The Size Of Android Application UpdatesDelta++ Reducing The Size Of Android Application Updates
Delta++ Reducing The Size Of Android Application Updates
 
AUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEMAUTOMOBILE MANAGEMENT SYSTEM
AUTOMOBILE MANAGEMENT SYSTEM
 
Quick guide to plan and execute a load test
Quick guide to plan and execute a load testQuick guide to plan and execute a load test
Quick guide to plan and execute a load test
 
Communication in android
Communication in androidCommunication in android
Communication in android
 
Delta++ reducing the size of android application updates
Delta++ reducing the size of android application updatesDelta++ reducing the size of android application updates
Delta++ reducing the size of android application updates
 
Abnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android SmartphoneAbnormality in Elderly Fall using Android Smartphone
Abnormality in Elderly Fall using Android Smartphone
 

Plus de Singsys Pte Ltd

Technical Seminar Series: GIT Pull Requests Best Practices
Technical Seminar Series:  GIT Pull Requests Best PracticesTechnical Seminar Series:  GIT Pull Requests Best Practices
Technical Seminar Series: GIT Pull Requests Best PracticesSingsys Pte Ltd
 
Laravel Security Standards
Laravel Security Standards Laravel Security Standards
Laravel Security Standards Singsys Pte Ltd
 
Android OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating SystemAndroid OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating SystemSingsys Pte Ltd
 
How to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidHow to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidSingsys Pte Ltd
 
iOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesiOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesSingsys Pte Ltd
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsSingsys Pte Ltd
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdkSingsys Pte Ltd
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginnersSingsys Pte Ltd
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
Joomla 3 installation and management guide
Joomla 3 installation and management guideJoomla 3 installation and management guide
Joomla 3 installation and management guideSingsys Pte Ltd
 
Joomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialJoomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialSingsys Pte Ltd
 
Technical seo tips for web developers
Technical seo tips for web developersTechnical seo tips for web developers
Technical seo tips for web developersSingsys Pte Ltd
 
WordPress Website Design and Development
WordPress Website Design and DevelopmentWordPress Website Design and Development
WordPress Website Design and DevelopmentSingsys Pte Ltd
 
Points for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websitesPoints for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websitesSingsys Pte Ltd
 

Plus de Singsys Pte Ltd (20)

Technical Seminar Series: GIT Pull Requests Best Practices
Technical Seminar Series:  GIT Pull Requests Best PracticesTechnical Seminar Series:  GIT Pull Requests Best Practices
Technical Seminar Series: GIT Pull Requests Best Practices
 
Laravel Security Standards
Laravel Security Standards Laravel Security Standards
Laravel Security Standards
 
Android OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating SystemAndroid OS - The Journey of most popular Operating System
Android OS - The Journey of most popular Operating System
 
How to do Memory Optimizations in Android
How to do Memory Optimizations in AndroidHow to do Memory Optimizations in Android
How to do Memory Optimizations in Android
 
iOS Application Battery Optimization Techniques
iOS Application Battery Optimization TechniquesiOS Application Battery Optimization Techniques
iOS Application Battery Optimization Techniques
 
How to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy StepsHow to Create WordPress Website in Easy Steps
How to Create WordPress Website in Easy Steps
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
SoLoMo
SoLoMoSoLoMo
SoLoMo
 
Introduction to facebook sdk
Introduction to facebook sdkIntroduction to facebook sdk
Introduction to facebook sdk
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Joomla 3 installation and management guide
Joomla 3 installation and management guideJoomla 3 installation and management guide
Joomla 3 installation and management guide
 
Joomla Introduction & Installation Tutorial
Joomla Introduction & Installation TutorialJoomla Introduction & Installation Tutorial
Joomla Introduction & Installation Tutorial
 
Basic of web design
Basic of web designBasic of web design
Basic of web design
 
Embedded Technology
Embedded TechnologyEmbedded Technology
Embedded Technology
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Technical seo tips for web developers
Technical seo tips for web developersTechnical seo tips for web developers
Technical seo tips for web developers
 
WordPress Website Design and Development
WordPress Website Design and DevelopmentWordPress Website Design and Development
WordPress Website Design and Development
 
Being a designer
Being a designerBeing a designer
Being a designer
 
Points for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websitesPoints for Design and Development of SEO friendly websites
Points for Design and Development of SEO friendly websites
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

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