This project is a native Android app developed to simulate a Pokedex, consuming the PokeApi. It's an application developed following the best practices in Android Development.
- 📱 UI & Features
- 🛠 Architecture
- 📚 Libraries & Tools
- 📝 Commits pattern
- 🔍 Static Code Analysis
- 🏗️ How Build/Run the project?
- 🚂 CI/CD
- 🧪 Unit Tests & Code Coverage
- ⚙️ UI Tests
- 🚧 Next steps
Pagination |
Shared Element Transition (Views & XML) |
![]() |
![]() |
This app was developed using the MVVM architecture pattern and following the Clean Architecture concepts.
Currently, the system has a modularization by layer with:
app
- application classpresentation
- views, viewModels and UI modelsdomain
- use cases, repositories contracts and domain modelsdata
- repositories implementations, and network classescommon-test
- test classes reused in all modules
The structure is as follows:
- Fragments & Navigation Component - UI and Navigation
- Retrofit, Okhttp & Moshi - Network calls
- Hilt - Dependency injection
- Glide - Load images in the app
- JUnit & Mockk - Unit tests
- JaCoCo - Code Coverage
- Espresso & MockWebServer - UI/Instrumented Tests
In this project it's being used the Karma commit convention to keep project readability.
It's being used Ktlint to standardize Kotlin code, to check, run:
./gradlew ktlintCheck
And to format, run:
./gradlew ktlintFormat
All rules you can find in .editorconfig
file.
First, build the project with the following command:
./gradlew assembleDebug
Then, install it on a connected device:
./gradlew installDebug
In this project, a CI/CD
workflow was configured using GitHub Actions. It ensures that the code is analyzed, tested, and the application is automatically compiled when necessary.
The configured workflow performs the following steps:
- Check out code: Clones the repository into the GitHub Actions virtual machine.
- Java setup: Sets up the required Java version (Java 17, Temurin distribution).
- Grant permissions: Grants execution permissions to use the
gradlew
script. - Static code analysis: Runs
ktlintCheck
to ensure the code style. - Unit testing: Executes the unit tests with
testDebugUnitTest
. - Build APK: Generates the debug APK.
- Upload APK: Saves the generated APK as an artifact for direct download.
To run this workflow, just go to:
Actions
->Android CI/CD
->Run Workflow
This project has unit tests to improve code quality and security, along with JaCoCo to monitor test coverage.
To run unit tests:
./gradlew testDebugUnitTest
To generate the code coverage of the entire project:
./gradlew jacocoTestReport
Once the coverage command is executed, the report will be available at:
build/reports/jacoco/jacocoTestReport/html/index.html
Also, this project has instrumented and UI tests using Espresso
and MockWebServer
.
To run:
./gradlew app:connectedAndroidTest
- Integrate UI tests in code coverage
- Integrate UI tests in CI
- Migrate to modularization by feature
- Add swipe to refresh