Skip to content

About

BatteryMeasurementApp

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EEI Commission — Energy Efficiency Index Measurement Tool

A Kotlin Multiplatform (Compose Multiplatform) mobile application for measuring and calculating the Energy Efficiency Index (EEI) of mobile devices, following EU Regulation 2023/1669.

Open source under EUPL-1.2.


Overview

The EEI measures how energy-efficient a device is during a standardized "Day of Use" scenario defined by the EU regulation. This tool automates the measurement process across Android and iOS from a single shared codebase.

Current status: foundational structure in place — battery UI, Appium tests, EUPL compliance tooling. Core EEI features (battery measurement, Day of Use scenario, EEI calculation, reporting) are under active development.


Project Structure

├── composeApp/          # Shared Compose Multiplatform UI + business logic
│   └── src/
│       ├── commonMain/  # Common code (UI, EEI logic)
│       ├── androidMain/ # Android-specific implementations
│       └── iosMain/     # iOS-specific implementations
├── androidApp/          # Android application module
├── iosApp/              # iOS application (Xcode project)
├── appiumTests/         # Appium E2E tests (Kotlin/JUnit 5)
├── sharedTestTags/      # Shared test tag constants (KMP)
├── scripts/             # Build and compliance scripts
└── gradle/              # Gradle wrapper and version catalog

Prerequisites

Build

  • JDK 17+
  • Android Studio (Hedgehog or later) with Android SDK 34+
  • Xcode 15+ (iOS, macOS only)
  • Kotlin Multiplatform Mobile plugin (Android Studio)
# Install Gradle wrapper (already included)
./gradlew --version

Testing

  • Node.js 16+
  • Appium 2.x
npm install -g appium
appium driver install uiautomator2   # Android
appium driver install xcuitest       # iOS

Building

# Android APK
./scripts/build_apps.sh --android

# iOS simulator app
./scripts/build_apps.sh --ios

# Both platforms
./scripts/build_apps.sh --all
Platform Output path
Android androidApp/build/outputs/apk/debug/androidApp-debug.apk
iOS build/ios-derived-data/Build/Products/Debug-iphonesimulator/

Code Quality

Static analysis is enforced via detekt:

./gradlew detekt

Configuration: detekt.yml. Rules are applied to all modules. Compose Multiplatform generated sources are automatically excluded.


Running Tests

Unit Tests

No device or emulator required. Runs on JVM.

# Run all unit tests
./gradlew :composeApp:testDebugUnitTest

# Open HTML report
open composeApp/build/reports/tests/testDebugUnitTest/index.html

Covered by unit tests:

  • BatteryServiceTest (11 tests) — battery level range, availability, edge cases
  • Uses FakeBatteryDataSource — no platform runtime needed

E2E Tests (Appium)

Start Appium server first:

appium --port 4723 --address 127.0.0.1

Then run:

./gradlew :appiumTests:androidTest   # Android
./gradlew :appiumTests:iosTest       # iOS
./gradlew :appiumTests:allAppiumTests

Override APK path or device via system properties:

./gradlew :appiumTests:androidTest -DapkPath=/path/to/app.apk

See appiumTests/README.md and appiumTests/ANDROID_STUDIO_SETUP.md for IDE setup.

Test Tags (Accessibility IDs)

Element Tag
Start Measurement Button start_measurement_button
Result Label result_label

Troubleshooting

Android

  • Verify ANDROID_HOME is set
  • Check emulator is running: adb devices

iOS

  • Install Xcode CLI tools: xcode-select --install
  • List simulators: xcrun simctl list devices

Appium

  • Check server status: curl http://127.0.0.1:4723/status
  • List installed drivers: appium driver list --installed

License Compliance

This project enforces EUPL-1.2 compliance on all dependencies.

python scripts/check-licenses.py       # Check compliance
python scripts/update-dependencies-md.py  # Update DEPENDENCIES.md

All new dependencies must be EUPL-1.2 compatible. See DEPENDENCIES.md for the full analysis.

Compliance status:

  • All dependencies are EUPL-compatible
  • All source files carry EUPL-1.2 license headers
  • Automated compliance checks run on every push (GitHub Actions)

References: EUPL-1.2 text · EUPL compatibility guidelines


Contributing

See CONTRIBUTING.md. This project uses conventional commits and semantic versioning. Changes are tracked in CHANGELOG.md.


License

Copyright © 2026 Ahmed ADOUANI

Licensed under the EUPL, Version 1.2. You may obtain a copy of the licence at: https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12

SPDX-License-Identifier: EUPL-1.2

About

BatteryMeasurementApp

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages