SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Enforcing Green Code
With Android Lint
Olivier Le Goaer @ A-MOBILE 2020
- September 21, 2020 - Melbourne, Australia -
Context of Work
✗ Green Software
– Beyond fast-paced hardware advances, foster
development of energy-efficient software
✗ Mobile Software
– Battery-powered device non-connected to permanent
power (e.g. SmartPhone)
– Overconsumption of mobile apps implies more frequent
charges and ultimately battery depletion
Greenness is a matter of quality
✗ Poorly designed apps may drain the battery
excessively
✗ Greenness is a quality attribute that may be
statically checked by a lint tool
✗ Ultimately, the quality level reached by apps
should be rewarded by a green badge/score
Green Bugs within Android apps
✗ Green bugs are symptoms that something may
be wrong with the app's battery usage
✗ Android-specific green bugs are not classic
code smells merely applied to Android
– Refactoring of “God Class”, “God Method”, and “Feature
Envy” is even counterproductive*
* An Empirical Study on the Impact of Android Code Smells on Resource Usage, Oliveira et al., SEKE 2018
Catalog of Android Green Bugs
✗ Define a catalog of smells that have an actual
impact on power consumption
✗ Energy-related smells reside in an Android
project, not only in source code (.java/.kt)
✗ 13 green bugs were described in the paper. The
latest catalog describes 26 bugs
– http://green.pauware.com/android-lint/
The 13 Android Green Bugs
Name Severity Scope
Everlasting Service ERROR Source code
Sensor Leak ERROR Source code
Internet In The Loop ERROR Source code
Dark UI WARNING Manifest, Style, Drawable
Sensor Coalesce WARNING Source code
Durable Wake Lock WARNING Source code
Uncompressed Data
Transmission
WARNING Source code
Rigid Alarm WARNING Source code, Gradle
Dirty Boot WARNING Source code, Manifest
Keep Screen On INFORMATIONAL Source code, Layout
Keep CPU On INFORMATIONAL Source code, Manifest
Battery-Efficient Location INFORMATIONAL Source code, Gradle
Bluetooth Low-Energy INFORMATIONAL Source code
Keep Screen On (example)
« To avoid draining
the battery, an Android
device that is left idle
quickly falls asleep.
However, there are
times when an
application needs to
wake up the screen and
keep it awake to
complete some work. »
[Doc] 
Programmatically (Java)
Declaratively (xml)
Android Lint Framework
✗ Extensible Framework : add custom checks to
the 350 built-in checks
✗ Jetbrain UAST = AST unifying Java and Kotlin
✗ Complete scan of an Android project (code,
ressources, manifest, …)
✗ Both on-the-fly and manual inspections within
Android Studio IDE
Greenness is not performance
✗ Power-saving may be a side effect of
performance, but not necessarily so
✗ Greenness merits its full-fledged category
NEW
Implementation details
✗ Green Bugs are issues in a registry
✗ Issues are reported by detectors
✗ A detector implements one or more scanners
✗ Visitor-style programming (in Java or Kotlin)
✗ Utils avoid doing things « the hard way »
Live demo: Dark UI
Research: what's next?
✗ Discovering unexplainable green bugs
– As opposed to the current green bugs that are explained
by the Android Reference Documentation
✗ Green bugs assessment at large scale
– Runtime testbed and automated UI test for millions of
apps is still a scientific challenge
Tooling: what's next?
Green Linter
Web-based Backend
(Green Quality Gates)
+
Gamification
Score 3/5
Summary
✗ Green coding habits should be rewarded
✗ Real-life Android development is predominantly
native, either in Java or Kotlin, with Android
Studio IDE
✗ Static analysis applies to and scales for any
app under development
✗ Android developers trust Android Lint
Thank you for
your attention
- Questions? -

Contenu connexe

Tendances

Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
Mobile + Cloud + IoT = Future
Mobile + Cloud + IoT = FutureMobile + Cloud + IoT = Future
Mobile + Cloud + IoT = FutureAndri Yadi
 
Android presentation
Android presentationAndroid presentation
Android presentationImam Raza
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Ahsanul Karim
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better PerformanceElif Boncuk
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentProf. Erwin Globio
 
Remote Android Rendering
Remote Android RenderingRemote Android Rendering
Remote Android RenderingJoel Isaacson
 

Tendances (7)

Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Mobile + Cloud + IoT = Future
Mobile + Cloud + IoT = FutureMobile + Cloud + IoT = Future
Mobile + Cloud + IoT = Future
 
Android presentation
Android presentationAndroid presentation
Android presentation
 
Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2Android Workshop Day 1 Part 2
Android Workshop Day 1 Part 2
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Remote Android Rendering
Remote Android RenderingRemote Android Rendering
Remote Android Rendering
 

Similaire à Enforcing Green Code With Android Lint

Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...JPINFOTECH JAYAPRAKASH
 
Cloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the EnterpriseCloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the EnterpriseTechWell
 
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...Curiosity Software Ireland
 
Oliot daeyoungkim-kaist-2015 - final - short
Oliot daeyoungkim-kaist-2015 - final - shortOliot daeyoungkim-kaist-2015 - final - short
Oliot daeyoungkim-kaist-2015 - final - shortDaeyoung Kim
 
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.ioapidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.ioapidays
 
IRJET - Garbage Collecting Robot using IoT
IRJET - Garbage Collecting Robot using IoTIRJET - Garbage Collecting Robot using IoT
IRJET - Garbage Collecting Robot using IoTIRJET Journal
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009sullis
 
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...Applitools
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...DicodingEvent
 
Getting started as an android developer
Getting started as an  android developerGetting started as an  android developer
Getting started as an android developerAva Meredith
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsPorfirio Tramontana
 
IRJET- Obfuscation: Maze of Code
IRJET- Obfuscation: Maze of CodeIRJET- Obfuscation: Maze of Code
IRJET- Obfuscation: Maze of CodeIRJET Journal
 
What is Android L ?
What is Android L ?What is Android L ?
What is Android L ?E2LOGY
 
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous IntegrationExperitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous IntegrationExperitest
 
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019Eclipse IoT
 
Content Oriented Architectures: Putting Content at the Center of CM Projects
Content Oriented Architectures: Putting Content at the Center of CM ProjectsContent Oriented Architectures: Putting Content at the Center of CM Projects
Content Oriented Architectures: Putting Content at the Center of CM ProjectsScott Abel
 

Similaire à Enforcing Green Code With Android Lint (20)

Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...Green droid automated diagnosis of energy inefficiency for smartphone applica...
Green droid automated diagnosis of energy inefficiency for smartphone applica...
 
The road to green code
The road to green codeThe road to green code
The road to green code
 
Cloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the EnterpriseCloud-Based, Automated Mobile App Testing for the Enterprise
Cloud-Based, Automated Mobile App Testing for the Enterprise
 
Android lollipop
Android lollipopAndroid lollipop
Android lollipop
 
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...
Curiosity and Sauce Labs present - When to stop testing: 3 dimensions of test...
 
Oliot daeyoungkim-kaist-2015 - final - short
Oliot daeyoungkim-kaist-2015 - final - shortOliot daeyoungkim-kaist-2015 - final - short
Oliot daeyoungkim-kaist-2015 - final - short
 
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.ioapidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io
apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io
 
IRJET - Garbage Collecting Robot using IoT
IRJET - Garbage Collecting Robot using IoTIRJET - Garbage Collecting Robot using IoT
IRJET - Garbage Collecting Robot using IoT
 
Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009Getting Started with Android - OSSPAC 2009
Getting Started with Android - OSSPAC 2009
 
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...
Top 5 Features To Look for in a Codeless Automation Solution -- Presentation ...
 
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
Play with Testing on Android - Gilang Ramadhan (Academy Content Writer at Dic...
 
Getting started as an android developer
Getting started as an  android developerGetting started as an  android developer
Getting started as an android developer
 
A technique for parallel gui testing of android applications
A technique for parallel gui testing of android applicationsA technique for parallel gui testing of android applications
A technique for parallel gui testing of android applications
 
Industrial IoT bootcamp
Industrial IoT bootcampIndustrial IoT bootcamp
Industrial IoT bootcamp
 
IRJET- Obfuscation: Maze of Code
IRJET- Obfuscation: Maze of CodeIRJET- Obfuscation: Maze of Code
IRJET- Obfuscation: Maze of Code
 
What is Android L ?
What is Android L ?What is Android L ?
What is Android L ?
 
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous IntegrationExperitest-Infosys Co-Webinar on Mobile Continuous Integration
Experitest-Infosys Co-Webinar on Mobile Continuous Integration
 
Beyond Traditional Mobile Testing
Beyond Traditional Mobile TestingBeyond Traditional Mobile Testing
Beyond Traditional Mobile Testing
 
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019
Exploring the Trend Toward the Edge | Eclipse IoT Day Santa Clara 2019
 
Content Oriented Architectures: Putting Content at the Center of CM Projects
Content Oriented Architectures: Putting Content at the Center of CM ProjectsContent Oriented Architectures: Putting Content at the Center of CM Projects
Content Oriented Architectures: Putting Content at the Center of CM Projects
 

Plus de Olivier Le Goaër

Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
 Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary StudyOlivier Le Goaër
 
Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Olivier Le Goaër
 
Executable modeling & dynamic adaptation
Executable modeling & dynamic adaptationExecutable modeling & dynamic adaptation
Executable modeling & dynamic adaptationOlivier Le Goaër
 
Adaptation d'exécution de modèles : vers des iDSML adaptables
Adaptation d'exécution de modèles : vers des iDSML adaptablesAdaptation d'exécution de modèles : vers des iDSML adaptables
Adaptation d'exécution de modèles : vers des iDSML adaptablesOlivier Le Goaër
 
Yet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile developmentYet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile developmentOlivier Le Goaër
 
Introduction à l'approche ADM de l'OMG
Introduction à l'approche ADM de l'OMGIntroduction à l'approche ADM de l'OMG
Introduction à l'approche ADM de l'OMGOlivier Le Goaër
 
Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]Olivier Le Goaër
 

Plus de Olivier Le Goaër (11)

Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
 Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
Ecological Impact of Native vs. Cross-Platform Mobile Apps: a Preliminary Study
 
Introduction au langage SQL
Introduction au langage SQLIntroduction au langage SQL
Introduction au langage SQL
 
Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !Les Web Services en 60 diapos chrono !
Les Web Services en 60 diapos chrono !
 
Executable modeling & dynamic adaptation
Executable modeling & dynamic adaptationExecutable modeling & dynamic adaptation
Executable modeling & dynamic adaptation
 
Cours JavaScript
Cours JavaScriptCours JavaScript
Cours JavaScript
 
Adaptation d'exécution de modèles : vers des iDSML adaptables
Adaptation d'exécution de modèles : vers des iDSML adaptablesAdaptation d'exécution de modèles : vers des iDSML adaptables
Adaptation d'exécution de modèles : vers des iDSML adaptables
 
Formation VBA Excel
Formation VBA ExcelFormation VBA Excel
Formation VBA Excel
 
Yet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile developmentYet another DSL for cross platforms mobile development
Yet another DSL for cross platforms mobile development
 
Introduction à l'approche ADM de l'OMG
Introduction à l'approche ADM de l'OMGIntroduction à l'approche ADM de l'OMG
Introduction à l'approche ADM de l'OMG
 
Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]Syntaxe concrète des DSL en IDM [avec Xtext]
Syntaxe concrète des DSL en IDM [avec Xtext]
 
Programmation sous Android
Programmation sous AndroidProgrammation sous Android
Programmation sous Android
 

Dernier

BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 

Dernier (20)

BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 

Enforcing Green Code With Android Lint

  • 1. Enforcing Green Code With Android Lint Olivier Le Goaer @ A-MOBILE 2020 - September 21, 2020 - Melbourne, Australia -
  • 2. Context of Work ✗ Green Software – Beyond fast-paced hardware advances, foster development of energy-efficient software ✗ Mobile Software – Battery-powered device non-connected to permanent power (e.g. SmartPhone) – Overconsumption of mobile apps implies more frequent charges and ultimately battery depletion
  • 3. Greenness is a matter of quality ✗ Poorly designed apps may drain the battery excessively ✗ Greenness is a quality attribute that may be statically checked by a lint tool ✗ Ultimately, the quality level reached by apps should be rewarded by a green badge/score
  • 4. Green Bugs within Android apps ✗ Green bugs are symptoms that something may be wrong with the app's battery usage ✗ Android-specific green bugs are not classic code smells merely applied to Android – Refactoring of “God Class”, “God Method”, and “Feature Envy” is even counterproductive* * An Empirical Study on the Impact of Android Code Smells on Resource Usage, Oliveira et al., SEKE 2018
  • 5. Catalog of Android Green Bugs ✗ Define a catalog of smells that have an actual impact on power consumption ✗ Energy-related smells reside in an Android project, not only in source code (.java/.kt) ✗ 13 green bugs were described in the paper. The latest catalog describes 26 bugs – http://green.pauware.com/android-lint/
  • 6. The 13 Android Green Bugs Name Severity Scope Everlasting Service ERROR Source code Sensor Leak ERROR Source code Internet In The Loop ERROR Source code Dark UI WARNING Manifest, Style, Drawable Sensor Coalesce WARNING Source code Durable Wake Lock WARNING Source code Uncompressed Data Transmission WARNING Source code Rigid Alarm WARNING Source code, Gradle Dirty Boot WARNING Source code, Manifest Keep Screen On INFORMATIONAL Source code, Layout Keep CPU On INFORMATIONAL Source code, Manifest Battery-Efficient Location INFORMATIONAL Source code, Gradle Bluetooth Low-Energy INFORMATIONAL Source code
  • 7. Keep Screen On (example) « To avoid draining the battery, an Android device that is left idle quickly falls asleep. However, there are times when an application needs to wake up the screen and keep it awake to complete some work. » [Doc]  Programmatically (Java) Declaratively (xml)
  • 8. Android Lint Framework ✗ Extensible Framework : add custom checks to the 350 built-in checks ✗ Jetbrain UAST = AST unifying Java and Kotlin ✗ Complete scan of an Android project (code, ressources, manifest, …) ✗ Both on-the-fly and manual inspections within Android Studio IDE
  • 9. Greenness is not performance ✗ Power-saving may be a side effect of performance, but not necessarily so ✗ Greenness merits its full-fledged category NEW
  • 10. Implementation details ✗ Green Bugs are issues in a registry ✗ Issues are reported by detectors ✗ A detector implements one or more scanners ✗ Visitor-style programming (in Java or Kotlin) ✗ Utils avoid doing things « the hard way »
  • 12. Research: what's next? ✗ Discovering unexplainable green bugs – As opposed to the current green bugs that are explained by the Android Reference Documentation ✗ Green bugs assessment at large scale – Runtime testbed and automated UI test for millions of apps is still a scientific challenge
  • 13. Tooling: what's next? Green Linter Web-based Backend (Green Quality Gates) + Gamification Score 3/5
  • 14. Summary ✗ Green coding habits should be rewarded ✗ Real-life Android development is predominantly native, either in Java or Kotlin, with Android Studio IDE ✗ Static analysis applies to and scales for any app under development ✗ Android developers trust Android Lint
  • 15. Thank you for your attention - Questions? -