This project is an Android application that displays a list of products. The app follows Clean Architecture principles and uses Retrofit for network operations, Hilt for dependency injection, and includes unit tests. The UI is built using Fragments and XML layouts.
This project follows Clean Architecture, which separates the code into different layers which includes Repository Pattern and MVVM:
- Domain Layer: Contains business logic and use cases.
- Data Layer: Handles data operations, including network calls and data caching.
- Presentation Layer: Includes ViewModels, Fragments, and UI components.
- Retrofit: For making network requests.
- Hilt: For dependency injection.
- LiveData: For observable data.
- ViewModel: For managing UI-related data.
- Coroutines: For asynchronous programming.
- JUnit: For unit testing.
- Mockito: For mocking in tests.
- Picasso: For loading images.
To run this project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/products-app.git cd products-app
-
Open the project in Android Studio:
open -a "Android Studio".
-
Sync the project with Gradle files by clicking on the
Sync Now
button in the banner at the top of the IDE. -
Build and run the app on an emulator or physical device by clicking the
Run
button.
To use the app, follow these steps:
- Launch the app on your device or emulator.
- The app will display a splash screen followed by a list of products.
- You can click on a product to view its details.
- Display Products List: Fetches and displays a list of products from a remote API.
- Error Handling: Displays appropriate messages for network errors.
- Loading Indicators: Shows a Shimmer Effect while data is being fetched.
The project includes unit tests for the ViewModel and use cases.
-
Running Tests:
- Open the
test
directory in Android Studio. - Right-click on the
com.example.route_task
package and selectRun Tests
.
- Open the
studio64_nZw2UXmsly.mp4
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name.
- Make your changes.
- Submit a pull request.
You are welcome to contact me and send your feedback to my gmail: [email protected]