Loop Habit Tracker (formerly known as uhabits) is an open-source habit‑tracking Android app written in Java and Kotlin. Designed to help you build positive habits, the app features a robust source code, including uhabits-core for multiplatform logic and uhabits-android for UI. By leveraging Kotlin Multiplatform, developers can extract core business logic and reuse it across desktop or web applications. The GitHub repository includes comprehensive importers/exporters, such as HabitBullCSVImporter, HabitsCSVExporter, and LoopDBImporter, which demonstrate best practices in modular code architecture and CSV parsing.

The source code uses exponential smoothing to calculate a habit’s “strength,” making the tracking both reliable and statistically sound. For example:
double alpha = 0.1; double currentStrength = previousStrength * (1 - alpha) + (performedToday ? alpha : 0); // See uhabits-core/utils/ScoreList.java for details.
The project follows a layered structure:
- uhabits-core: pure-Java/Kotlin logic, time utilities, data models, file/database abstractions.
- uhabits-android: Android UI, reminders, widgets; interfaces with core modules using dependency injection.
- uhabits-core-legacy: legacy multiplatform support for iOS and web.
The README also details:
- Badge links for build status, license, and Maven Central artifacts.
- A clear Gradle build / IDE setup: clone, import as Gradle project, connect device, and run.
- Usage examples of Dependency Injection (Dagger/JavaX):
@Inject lateinit var repository: HabitRepository
- Instructions for testing via unit tests in core and Android instrumentation tests in uhabits-android.
By reading and contributing to the source code, developers can learn how to structure cross‑platform Kotlin projects, implement CSV import/export, handle date/time logic, and design clean architecture separation between UI and business domains.
C. Metadata
- Author: iSoron (GitHub iSoron)
- Programming Languages: Java, Kotlin
- License: GPL‑3.0‑only
- License Constraints: Any redistributed or modified version must also be licensed under GPL‑3.0‑only. Commercial closed‑source integration is not permitted without complying with GPL terms.
- Repository: https://github.com/iSoron/uhabits