A modern Android application built with Jetpack Compose that displays Pokemon data from the PokeAPI. The app features a clean, intuitive interface for browsing Pokemon lists and viewing detailed information about individual Pokemon.
- Pokemon List View: Browse through a paginated list of Pokemon with names and IDs
- Pokemon Details: View detailed information about individual Pokemon including:
- Pokemon name and ID
- Height
- High-quality Pokemon images
- Navigation: Smooth navigation between list and details screens
- Modern UI: Built with Material Design 3 and Jetpack Compose
- Image Loading: Efficient image loading with Coil
- Error Handling: Graceful error handling with user-friendly messages
- Loading States: Proper loading indicators during data fetching
- Dependency Injection: Clean architecture with Hilt DI
The app follows Clean Architecture with multi-module organization for optimal scalability, testability, and build performance:
- 7 Gradle Modules: Organized by layer and feature for parallel development
- Clean Architecture Layers: Domain, Data, Presentation clearly separated
- Feature Modules: Independent, self-contained feature implementations
- Dependency Inversion: Domain layer is pure Kotlin with no Android dependencies
- MVVM Pattern: Model-View-ViewModel for UI layer
- Use Cases: Business logic encapsulation in domain layer
- Repository Pattern: Data layer abstraction
- Dependency Injection: Hilt for compile-time safe DI
- State Management: Reactive state with StateFlow and Kotlin Result type
- Mapper Pattern: Clean separation between DTOs and Domain entities
:app (Application entry point)
βββ :feature:pokemon-list
βββ :feature:pokemon-details
βββ :data
βββ :core:ui
βββ :core:common
:feature:pokemon-list & :feature:pokemon-details
βββ :domain (Use cases)
βββ :data (Repository implementations)
βββ :core:ui (Shared UI components)
βββ :core:common (Utilities, models)
:data
βββ :domain (Repository interfaces)
βββ :core:common (Shared models)
:core:ui
βββ :core:common (Shared models)
:domain
βββ Pure Kotlin module (no dependencies)
:core:common
βββ Android library (shared utilities)
Click to view app screenshots
Pokemon List Screen - Browse through Pokemon with names and IDs
Pokemon Details Screen - View detailed Pokemon information
The app consists of two main screens:
- Pokemon List Screen: Displays a grid of Pokemon cards with names and IDs
- Pokemon Details Screen: Shows comprehensive Pokemon information in a beautiful card layout
- Kotlin: Primary programming language
- Android SDK: Target SDK 35, Minimum SDK 24
- Jetpack Compose: Modern UI toolkit
- Material Design 3: Design system
- Jetpack Compose BOM:
2024.12.01 - Material 3: Modern Material Design components
- Navigation Compose:
2.9.5- Type-safe navigation - Activity Compose:
1.11.0- Compose integration - Lifecycle ViewModel Compose:
2.9.4- ViewModel integration
- Hilt Android:
2.48- Dependency injection framework - Hilt Navigation Compose:
1.2.0- Navigation integration - KSP:
1.9.22-1.0.17- Kotlin Symbol Processing
- Retrofit:
2.9.0- HTTP client for API calls - Gson Converter:
2.9.0- JSON serialization/deserialization - Coil Compose:
2.4.0- Image loading library
- AndroidX Core:
1.17.0- Core Android functionality - Lifecycle Runtime KTX:
2.9.4- Lifecycle-aware components - Kotlin Coroutines Core:
1.5.0- Coroutine support
- JUnit:
4.13.2- Unit testing framework - Mockito:
5.1.1- Mocking framework - Mockito Kotlin:
4.1.0- Kotlin-friendly mocking - Mockito Inline:
5.1.1- Inline mocking for final classes - Kotlin Coroutines Test:
1.7.3- Coroutine testing utilities - AndroidX Core Testing:
2.2.0- Android testing utilities - MockWebServer:
4.11.0- HTTP server for testing - Espresso:
3.7.0- UI testing framework - Compose UI Test: UI testing for Compose
-
Clone the repository
git clone https://github.com/kingrocfella/pokemonapp.git cd pokemonapp -
Open in Android Studio
- Open Android Studio
- Select "Open an existing project"
- Navigate to the project directory
-
Sync Project
- Android Studio will automatically sync the project
- Wait for Gradle sync to complete
-
Run the App
- Connect an Android device or start an emulator
- Click the "Run" button or press
Shift + F10
# Debug build (all modules)
./gradlew assembleDebug
# Release build (all modules)
./gradlew assembleReleaseThe project is configured for optimal build performance:
- Parallel builds: Multiple modules build simultaneously
- Build caching: Unchanged modules use cached outputs
- Incremental compilation: Only changed files recompile
For best performance, ensure gradle.properties includes:
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand=trueThe project is organized into 7 Gradle modules following Clean Architecture principles:
Mypokemonapplication/
βββ app/ # π± Application Module
β βββ src/main/
β β βββ java/.../
β β β βββ MainActivity.kt # Navigation host
β β β βββ PokemonApplication.kt # @HiltAndroidApp entry point
β β βββ res/ # App resources
β β βββ AndroidManifest.xml
β βββ build.gradle.kts # App module configuration
β
βββ domain/ # π§ Domain Module (Pure Kotlin)
β βββ src/main/java/.../domain/
β β βββ entities/
β β β βββ Pokemon.kt # Core domain entities
β β β βββ PokemonDetail.kt
β β β βββ PokemonListResult.kt
β β βββ repository/
β β β βββ PokemonRepository.kt # Repository interface
β β βββ usecase/
β β βββ GetPokemonListUseCase.kt # Business logic
β β βββ GetPokemonDetailsUseCase.kt
β βββ build.gradle.kts # Pure Kotlin module (java-library)
β
βββ data/ # πΎ Data Module
β βββ src/main/java/.../data/
β β βββ api/
β β β βββ ApiService.kt # Retrofit API interface
β β β βββ ApiRoutes.kt # API endpoints
β β βββ remote/dto/
β β β βββ PokemonListDto.kt # Network DTOs
β β β βββ PokemonDetailsDto.kt
β β βββ mapper/
β β β βββ PokemonMapper.kt # DTO β Domain mapping
β β βββ repository/
β β β βββ PokemonRepositoryImpl.kt # Repository implementation
β β β βββ PokemonUrlRepository.kt
β β βββ di/
β β β βββ DataModule.kt # Hilt bindings
β β βββ modules/
β β βββ NetworkModule.kt # Retrofit configuration
β βββ build.gradle.kts
β
βββ core/
β βββ common/ # π§ Core Common Module
β β βββ src/main/java/.../
β β β βββ common/
β β β β βββ screens/ScreenNames.kt # Navigation routes
β β β β βββ utils/Utils.kt # Utility functions
β β β βββ models/
β β β β βββ ViewModelState.kt # Shared state wrapper
β β β β βββ UISkeletonData.kt # UI state data
β β β βββ services/
β β β βββ NavigationService.kt # Navigation helper
β β βββ build.gradle.kts
β β
β βββ ui/ # π¨ Core UI Module
β βββ src/main/java/.../
β β βββ feature/
β β β βββ UISkeleton.kt # Shared UI components
β β βββ ui/theme/
β β βββ Color.kt # App colors
β β βββ Theme.kt # Material theme
β β βββ Type.kt # Typography
β βββ build.gradle.kts
β
βββ feature/
β βββ pokemon-list/ # π Pokemon List Feature Module
β β βββ src/main/java/.../pokemonlist/
β β β βββ PokemonListScreen.kt # Screen entry point
β β β βββ PokemonListViewModel.kt # ViewModel
β β β βββ DisplayPokemonList.kt # List UI
β β β βββ PokemonItem.kt # Item composable
β β βββ build.gradle.kts
β β
β βββ pokemon-details/ # π Pokemon Details Feature Module
β βββ src/main/java/.../pokemondetails/
β β βββ PokemonDetailsScreen.kt # Screen entry point
β β βββ PokemonDetailsViewModel.kt # ViewModel
β β βββ DisplayPokemonDetails.kt # Details UI
β β βββ PokemonDetailRow.kt # Row composable
β βββ build.gradle.kts
β
βββ static/ # πΈ Documentation Assets
β βββ PokemonListScreen.png
β βββ PokemonDetailsScreen.png
β
βββ build.gradle.kts # Root build configuration
βββ settings.gradle.kts # Module declarations
βββ gradle.properties # Build optimization
βββ gradle/
β βββ libs.versions.toml # Centralized version catalog
βββ ARCHITECTURE_DIAGRAM.md # Architecture documentation
βββ CLEAN_ARCHITECTURE.md # Clean architecture guide
βββ README.md # This file
The app uses the PokeAPI for Pokemon data:
- Base URL:
https://pokeapi.co/api/v2/ - Endpoints:
/pokemon- Pokemon list with pagination/pokemon/{id}- Individual Pokemon details
- Compile SDK: 36
- Target SDK: 35 (only in :app module)
- Minimum SDK: 24
- Java Version: 17
- Kotlin Version: 1.9.22
- Compose Compiler: 1.5.8
- Gradle: 8.11.1
- AGP (Android Gradle Plugin): 8.9.1
- Module Count: 7 (1 app + 6 libraries)
- Application Module (
:app): Usescom.android.applicationplugin - Android Libraries (5 modules): Use
com.android.libraryplugin - Pure Kotlin Library (
:domain): Usesjava-library+kotlin-jvmplugin
The modular architecture enables fast, isolated testing of individual modules:
# Run all unit tests
./gradlew test
# Run all Android unit tests
./gradlew testDebugUnitTest# Test domain layer only (super fast - pure JVM)
./gradlew :domain:test
# Test data layer only
./gradlew :data:testDebugUnitTest
# Test specific feature
./gradlew :feature:pokemon-list:testDebugUnitTest
# Test with auto-rerun on file changes (TDD mode)
./gradlew :feature:pokemon-list:testDebugUnitTest --continuous:app/src/test/ # Integration tests
βββ PokemonListViewModelTest.kt
βββ PokemonDetailsViewModelTest.kt
:domain/src/test/ # Pure unit tests (JVM)
βββ usecase/
βββ GetPokemonListUseCaseTest.kt
βββ GetPokemonDetailsUseCaseTest.kt
:data/src/test/ # Repository tests
βββ repository/
βββ PokemonRepositoryImplTest.kt
:feature:pokemon-list/src/test/ # Feature tests
βββ PokemonListViewModelTest.kt
:core:common/src/test/ # Utility tests
βββ utils/UtilsTest.kt
- Unit Tests: Test business logic in isolation
- ViewModel Tests: Test state management and UI logic
- Repository Tests: Test data layer with MockWebServer
- Mockito Integration: Mock external dependencies
- Coroutine Testing: Test async operations with
StandardTestDispatcher - Test Fixtures: Reusable fakes and test data