The Dog Image Application is an Android app that utilizes the Dog Image SDK to fetch and display dog images. The app is built using Kotlin and leverages Dagger Hilt for dependency injection.
- Fetch and display a single dog image at start
- Fetch and display the next dog image
- Fetch and display the previous dog image
- Fetch and display a list of dog images
The DogsSdkApp class is the main application class for your Android app. It extends the Application class and is annotated with @HiltAndroidApp, which indicates that Hilt should be used for dependency injection in this application.
-
Application Class:
DogsSdkAppextendsApplication, which is the base class for maintaining global application state. -
Hilt Dependency Injection: The
@HiltAndroidAppannotation triggers Hilt's code generation, including a base class for your application that serves as the application-level dependency container. -
Use Cases: The use cases (
GetFirstImage,GetNextImage,GetNNoOfImages) encapsulate specific business logic and interact with theImageRepository. -
Repository Pattern: The
ImageRepositoryinterface abstracts the data layer, providing a clean API for data access. -
Model: The
Imageclass represents the data model.
The architecture follows the principles of Clean Architecture, separating concerns into different layers and promoting testability and maintainability.
To set up the Dog Image Application, follow these steps:
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Open the project in Android Studio.
-
Build the project to download the necessary dependencies.