This Android app displays sports results using Clean Architecture, Jetpack Compose for UI, Hilt for dependency injection, Retrofit for API calls, JUnit 5 for unit tests, and Espresso for UI tests.
I had a tight deadline of 2-3 days for the assignment, so I made some decisions to work efficiently. I chose Clean Architecture because I'm familiar with it and it helps keep the code organized.
I identified parsing the server response as crucial. I went with the standard Android method of defining model classes and using the Gson library for parsing. However, this approach has a limitation – if the server adds a new sport, the app would need modifications.
To address this, I considered creating a custom utility to parse JSON strings and display data. This way, the app could dynamically handle new sports without requiring changes. Due to time constraints, I opted not to create this utility and stuck with the standard approach using Gson.
Despite this, I designed the model classes to minimize changes on the app side when the server introduces new sports or modifications. The goal was to ensure that the app remains extendable with minimal future adjustments.
- UI Framework: Jetpack Compose simplifies UI development with a declarative syntax, improving the overall development experience.
- Dependency Injection: Hilt is used for dependency injection, making it easier to manage and test dependencies in the application.
- Networking: Retrofit is used to make API calls to retrieve sports results from remote servers.
-
Check the unit tests for critical business logic and use cases. The
./gradlew clean test
command generates a unit test report.
-
Review the Espresso UI tests for the correctness of the UI components. The
./gradlew clean connectedAndroidTest
command generates a UI test report.
-
UI Improvements: Focused on business logic, code extensibility, and testing while designing a basic UI within the timeline. Improvements can be made.
-
Dynamic UI Logic: The current implementation assumes a generic structure for displaying sports results. Improve this area to dynamically adapt to new sports and automatically render UI changes based on the latest date.
-
Flexible Response Model: Enhance the logic to handle new sports without requiring manual updates to the result response model. Consider creating a utility to read JSON responses directly and dynamically adapt to changes.
Your feedback and suggestions for improvement are highly appreciated. Thank you for reviewing my work!