Skip to content
CAI
Software that uses CAICheck a score

voghDev/dagger2-clean-mvp-example

58.8

Adequate · 21 September 2026

1.8k

lines of production code

Java

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is an Android application that retrieves and displays user profiles from the RandomUser API. It employs a clean architecture with Dagger 2 for dependency injection, Retrofit for network calls, and a repository layer that supports both live API data and local file-based caching. The UI layer renders user lists using RecyclerViews and handles interactions through a presenter-based architecture.

How it got here

2015 — Initial project structure and architecture

9 changes.

The project was established with a comprehensive architecture leveraging Dagger 2, Retrofit, and the MVP pattern. Key features included the implementation of asynchronous interactors, a RecyclerView-based UI with a new User model, and a standardized presenter layer for improved testability.

2016 — Data source and architecture refactoring

9 changes.

The project underwent a significant architectural shift by migrating the API layer to Retrofit 2 and introducing a new use-case interface pattern for user operations. This period focused on decoupling the application logic through the addition of file-based and API-based data sources, along with implementing caching policies within the repository layer.

Features

Added UI view implementations for displaying user interactions via Toast and Snackbar

The app introduces three new classes in the ui.view package that implement specific use-case interfaces to handle user-facing notifications. ShowUserClickedToastImpl displays a Toast message when a user is clicked, and ShowUserGreetingToastImpl shows a Toast greeting for a user. Additionally, a stub implementation for ShowError (ShowErrorSnackbarImpl) is added, though its show method is currently empty. These changes provide the concrete UI logic for displaying messages to the user.

app/src/main/java/es/voghdev/prjdagger2/ui/view · high confidence

Added User model for randomuser API integration

A new User model class has been introduced to represent user data from the randomuser API. This model includes fields for id, name, address, username, thumbnail, facebookId, and email, enabling the application to parse and display user profile information.

app/src/main/java/es/voghdev/prjdagger2/global/model · high confidence

Added file-based user data source implementation

Introduced a new \GetUsersFileImpl\ class that loads user data from a local JSON resource file. This implementation parses the raw resource into a list of \User\ objects, providing an alternative data source for retrieving user information without network calls.

app/src/main/java/es/voghdev/prjdagger2/datasource/datafile · high confidence

Initial project structure and documentation

The repository was initialized with a comprehensive README.md detailing the project's architecture (CLEAN, MVP, Dagger2, Retrofit, Picasso), build configuration (.travis.yml, .gitignore), and licensing (LICENSE.txt). This entry reflects the initial commit that established the project's foundational files and documentation.

(repo-wide) · high confidence

Introduce user data caching via new repository and cache policies

The app now includes a new UserRepository that implements the GetUsers interface, managing user data retrieval through an API and file data sources. This change introduces a caching mechanism where the repository checks a cache policy before returning cached users. Two new cache policy implementations are added: NoCachePolicy, which always returns false for cache validity, and TimedCachePolicy, which validates cache based on a configurable expiration time (e.g., one minute). This allows the app to serve cached user data when available, improving performance by reducing redundant data fetches.

app/src/main/java/es/voghdev/prjdagger2/repository · high confidence

Introduces asynchronous interactor execution with thread pool and main thread utilities

The application now supports asynchronous execution of interactors via a new \Executor\ interface and \ThreadExecutor\ implementation, which runs background tasks on a configurable thread pool (core size 3, max size 5). This change enables the \GetUsersInteractor\ to perform network or data-fetching operations off the main thread, while \MainThread\ and its implementations (\MainThreadImpl\, \MainThreadDelayedImpl\) provide mechanisms to post results back to the UI thread. This architectural shift allows for more responsive user experiences by decoupling background processing from the main thread.

app/src/main/java/es/voghdev/prjdagger2/interactor · high confidence

New API model classes for user data

The app now includes new model classes in the API layer to map user data from the external service. These include IdApiEntry, StreetApiEntry, UserApiEntry, UserDateOfBirthApiEntry, UserLocationApiEntry, UserNameApiEntry, and UserPictureApiEntry. These classes define the structure for parsing user information such as name, location, picture, and date of birth, enabling the application to correctly interpret and display user profiles.

app/src/main/java/es/voghdev/prjdagger2/datasource/api/model · medium confidence

New user card renderer for displaying user details

A new UserRenderer component has been added to the app's UI layer, introducing a dedicated renderer for displaying user information in the list. This renderer handles the layout and binding of user data, including title, description, background, and thumbnail images, while also managing click listeners for user interactions.

app/src/main/java/es/voghdev/prjdagger2/ui/renderer · high confidence

Behavioural changes

Application class renamed and refactored

The global Application class has been renamed and its internal structure refactored, including the addition of Apache license headers and the removal of unused code. The class now explicitly initializes the dependency injection component and sets up an image cache directory, aligning with the broader migration to AndroidX and Dagger2 patterns.

app/src/main/java/es/voghdev/prjdagger2/global · medium confidence

Introduced Dagger 2 dependency injection for core application components

The app's dependency injection has been refactored to use Dagger 2. New modules (MainModule, UserListModule) and components (RootComponent, UserListComponent) are now responsible for providing and injecting dependencies such as the user interactor, repository, and UI view implementations into activities and presenters, replacing the previous manual or less structured injection approach.

app/src/main/java/es/voghdev/prjdagger2/global/di · high confidence

Introduction of new use-case interfaces for user operations

The application introduces four new interfaces in the \usecase\ package to define the contract for user-related operations: \GetUsers\ (for retrieving user lists), \ShowError\ (for displaying error messages), \ShowUserClicked\ (for handling user selection events), and \ShowUserGreeting\ (for displaying greetings). These interfaces replace previous implementations or abstract classes, providing a more flexible and decoupled way to handle these specific user interactions within the app's architecture.

app/src/main/java/es/voghdev/prjdagger2/usecase · high confidence

Migrate API layer to Retrofit 2 and adapt to RandomUser API

The API layer has been updated to use Retrofit 2 (upgrading from version 1.9.0), which changes how network calls are constructed and handled. The implementation now uses the RandomUser.me service, with new response models and a callback-based asynchronous API. A mock implementation has also been added to simulate user data and network conditions for testing.

app/src/main/java/es/voghdev/prjdagger2/datasource/api · high confidence

Migrate to AndroidX and introduce base activity with RecyclerView

The app's UI layer has been refactored to use AndroidX libraries, specifically replacing the legacy ListView with a RecyclerView for displaying user lists. A new BaseActivity abstract class has been introduced to centralize layout inflation and Butterknife injection, while UserListActivity now implements the UserListPresenter.View interface to manage the RecyclerView adapter and presenter interactions. Additionally, a RoundedTransformation for Picasso image loading has been added to apply circular/green-tinted image effects.

app/src/main/java/es/voghdev/prjdagger2/ui/activity · high confidence

Refactored presenter architecture with new base class and dependency injection

The presenter layer has been restructured to improve testability and modularity. A new abstract base class \Presenter\<T\>\ was introduced to standardize the lifecycle methods (initialize, resume, pause, destroy) and manage the view reference. The \UserListPresenter\ was updated to extend this base class and now utilizes constructor injection for its dependencies, specifically the \GetUsersInteractor\, allowing for easier mocking and testing. This change replaces the previous \AbsUserListPresenter\ and aligns the codebase with modern dependency injection practices.

app/src/main/java/es/voghdev/prjdagger2/ui/presenter · high confidence

Updated Retrofit API interface for user retrieval

The application's data source for fetching users has been updated to use the Retrofit 2.x API, specifically introducing a new interface that defines the endpoint for retrieving a random set of users. This change aligns the codebase with the newer Retrofit 2.5.0 library, which requires different method signatures and annotations compared to the previous version.

app/src/main/java/es/voghdev/prjdagger2/datasource/api/retrofit · high confidence

Test coverage

Added unit tests for the user list and repository layers

Added unit tests for the user list and repository layers, including new test classes for the UserListPresenter, UserRepository, and related collaborators. The changes introduce mock-based testing for the presenter's behavior (loading states, error handling, and user interactions) and verify the repository's data source selection and caching policies.

app/src/test · high confidence

Dependencies

Initial Android project structure and dependency configuration

The project is initialized with a new build configuration that targets Android SDK 28 and configures key dependencies including Dagger 2.27, Retrofit 2.5.0, Picasso 2.71828, and Renderers 3.4.0. The setup also enables AndroidX and Jetifier support, integrates Checkstyle for code quality, and includes basic test dependencies for JUnit and Mockito.

(dependencies) · medium confidence

Updated Gradle wrapper to version 6.2.2

The project's Gradle wrapper has been updated to use Gradle version 6.2.2. This ensures that all developers and CI systems use a consistent, pre-configured version of the Gradle build tool, eliminating potential build failures caused by version mismatches.

gradle · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 62 → 59 (-3.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 100 → 87 (-13.5)
  • Maturity 45 → 45 (+0.0)
  • Readiness 57 → 50 (-7.0)
  • Security 97 → 97 (+0.0)

Resolved (5)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • No exposed public API
  • Test reliability not included
  • dormant codebase — no living knowledge left to concentrate

New (4)

  • Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no licence statement (README.md)
  • No dependency advisory monitoring

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

voghDev/dagger2-clean-mvp-example was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 16f067fd112d0e30f56f97ae9e70cb3e88ba2632 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.