Upgrade to Pro — share decks privately, control downloads, hide ads and more …

apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io

apidays
January 08, 2023

apidays Paris 2022 - ecoCode mobile in a nutshell, Olivier Le Goaër, ecocode.io

apidays Paris 2022 - APIs the next 10 years: Software, Society, Sovereignty, Sustainability
December 14, 15 & 16, 2022

ecoCode mobile in a nutshell
Olivier Le Goaër, Green Software Researcher, ecocode.io & Associate Professor in Computer Science at Pau University
------

Check out our conferences at https://www.apidays.global/

Do you want to sponsor or talk at one of our conferences?
https://apidays.typeform.com/to/ILJeAaV8

Learn more on APIscene, the global media made by the community for the community:
https://www.apiscene.io

Explore the API ecosystem with the API Landscape:
https://apilandscape.apiscene.io/

Deep dive into the API industry with our reports:
https://www.apidays.global/industry-reports/

Subscribe to our global newsletter:
https://apidays.typeform.com/to/i1MPEW

apidays

January 08, 2023
Tweet

More Decks by apidays

Other Decks in Programming

Transcript

  1. December 15, 2022
    In a nutshell
    Apidays Paris
    Olivier Le Goaër

    View Slide

  2. 2023 SERIES OF EVENT
    New York
    May 16&17
    Australia
    October 11&12
    Singapore
    April 12&13
    Helsinki & North
    June 5&6
    Paris
    SEPTEMBER
    London
    November
    15&16
    June 28-30
    SILICON VALLEY
    March 14&15
    Dubai & Middle East
    February 22&23

    View Slide

  3. Apidays Paris December 15, 2022
    Associate Professor in Computer Science (France)
    STEE College (Sciences & Technologies for Energy and Environment)
    Research in the field of Software Engineering
    How to build “greener” software?
    Teaching Android programming
    Online course (+130k views)
    Olivier Le Goaër
    Who I am?

    View Slide

  4. Apidays Paris December 15, 2022
    Ecological
    impact
    Direct Indirect
    10% (FR)
    25%
    90% (FR)
    75%
    Terminals
    (...more devices!!!)
    Power
    Consumption
    eq. CO2, water, abiotic resources
    Context
    Loosely adapted from “iNUM : impacts environnementaux du numérique en France” (Jan. 2021)
    🔋Li-ion battery wear

    View Slide

  5. Apidays Paris December 15, 2022
    Insights
    Green code extends clean code with ecological concerns
    “ ”
    Carbon debt adds to the technical debt
    “ ”
    Software programs should have an eco-score too
    “ ”

    View Slide

  6. Apidays Paris December 15, 2022
    World-class solution to
    improve code quality
    Motivation
    No guidelines on how to
    write energy-friendly apps

    View Slide

  7. Apidays Paris December 15, 2022
    Energy code smells for Android
    Research Papers Dev Interviews
    API Reference Documentation

    View Slide

  8. Apidays Paris December 15, 2022
    http://olegoaer.perso.univ-pau.fr/android-energy-smells/
    # OPTIMIZED API (2)
    Fused Location, Bluetooth Low-Energy
    # LEAKAGE (3)
    Media Leak, Sensor Leak, Everlasting Service
    # BOTTLENECK (4)
    Internet In The Loop, Wifi Multicast Lock, Uncompressed
    Data Transmission, Uncached Data Reception
    # SOBRIETY (10)
    Dark UI, Day Night Mode, Brightness Override, Thrifty
    Geoloc, Thrifty BLE, Thrifty Motion Sensor, Thrifty
    Notification, Vibration-free, Torch-free, High Frame Rate
    # IDLENESS (6)
    Keep Screen On, Keep CPU On, Durable Wake Lock, Rigid
    Alarm, Continuous Rendering, Keep Voice Awake
    # POWER (4)
    Ignore Battery Optimizations, Companion in background,
    Charge Awareness, Save Mode Awareness
    # BATCH (3)
    [email protected], Sensor Coalesce, Job Coalesce
    # RELEASE (8)
    Supported Version Range, Same dependencies, Duplicate
    dependencies, Fat app, Clear Cache, Disable Obfuscation,
    Shrink Resources, Convert to WebP
    Catalog of energy code smells

    View Slide

  9. Apidays Paris December 15, 2022
    Focus on Keep CPU On
    PowerManager powerManager = (PowerManager)
    getSystemService(POWER_SERVICE);
    WakeLock wakeLock =
    powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
    "MyApp::MyWakelockTag");
    wakeLock.acquire();

    View Slide

  10. Apidays Paris December 15, 2022
    ● Statically detectable
    ○ Few green best practices resist to this “great filter”
    ● Broader detection scope
    ○ A native android project mixes Java, XML, File System, Gradle*
    ● Good and bad smells
    ○ Albeit code quality tools are only focused on bad smells
    ● Revamped User Interface
    ○ Green code merits its own user experience
    *Groovy script
    Highlights

    View Slide

  11. Apidays Paris December 15, 2022
    ● Commitment to digital commons
    ○ Released as OSS in January 2022 (hosted by Green IT assoc.)
    ○ https://github.com/green-code-initiative/ecoCode-mobile
    ● Attract early-adopters
    ○ Hackathon in Paris in June 2022 (in the presence of the VP of Products @
    SonarSource)
    ○ Next edition planned in March 2023
    Open Source Software
    new

    View Slide

  12. Apidays Paris December 15, 2022
    Currently Soon
    Technical guidelines

    View Slide

  13. Apidays Paris December 15, 2022
    Screenshots

    View Slide

  14. Apidays Paris December 15, 2022
    ● From academic
    ○ EcoAndroid [Ribeiro et al., 2021]
    ○ E-Debitum [Maia et al., 2020]
    ○ xAL [Fatimaa et al., 2020]
    ○ aDoctor [Iannone et al., 2020]
    ○ Green Android Lint [Le Goaer, 2019]
    ● From industry
    ○ EcoSonar [Accenture, 2022]
    ○ Greensight Sonar [Capgemini, 2022]
    Related works

    View Slide

  15. Apidays Paris December 15, 2022
    core
    web mobile AI cloud …
    Roadmap

    View Slide

  16. Apidays Paris December 15, 2022
    DevFest Perros-Guirec (oct. 2022)
    Extended talk

    View Slide

  17. Apidays Paris December 15, 2022
    (ekko, our mascotte)
    Live demo?

    View Slide