A Kotlin Multiplatform library example demonstrating how to read battery state across different platforms.
With KMP we can target various platforms. The table below lists the platforms, their status, and relevant screenshots:
| Platform | Screenshot | Tested? |
|---|---|---|
| Android | ![]() |
Yes |
| Windows | ![]() |
Yes |
| MacOS | ![]() |
Yes |
| iOS | ![]() |
No |
| Linux | N/A | Unstable |
- Native Battery Access: Demonstrates how to bridge platform-specific native APIs to Kotlin.
- Compose Multiplatform UI: Shared UI implementation across Android, Desktop, and iOS.
- Lightweight: Minimal dependencies, focused on educational content.
- JDK: Version 17 or higher.
- Gradle: The project uses the Gradle Wrapper; no manual Gradle installation is required.
- OS Requirements:
- macOS: Required for building iOS targets (with Xcode installed).
- Windows/Linux: Standard environment for Desktop and Android builds.
androidApp: An Android application module.composeApp: Contains shared UI logic for Compose Multiplatform.desktopApp: A Compose Desktop application module.iosAppCmp: An iOS application module.terminalApp: A native terminal application demonstrating battery state access.
Contributions are welcome! If you find a bug or have an improvement, please see the CONTRIBUTING.md file for guidelines.
This project is licensed under the MIT License. Please see the LICENSE file for details.
This project serves as a practice ground to explore the powerful features of Kotlin Multiplatform ( KMP). It demonstrates how to interact with platform-specific native APIs from common Kotlin code, which is a core strength of KMP. Feel free to use this as a reference for your own multiplatform explorations.



