The Online Images project is a sample Android application demonstrating the ideal usage of Hilt, Retrofit, and Pagination. The app fetches images from the Unsplash API and displays them in a gallery. Users can tap on an image to view it in full screen along with the author's name. The main screen also features a search bar to search for images based on user input. This project is primarily educational, showcasing how to use these libraries effectively and handle process death with SavedStateHandle in the ViewModel.
- Gallery Screen: Displays a grid of online images from the Unsplash API.
- Image Details: Tap on an image to view it in full screen with the author's name.
- Search Functionality: Search for images using the search bar.
- Pagination: Infinite scrolling to load more images.
- Handling Process Death: Demonstrates handling process death with SavedStateHandle in the ViewModel.
- Download the project.
- Open the project in Android Studio.
- Run the project from Android Studio.
- Install the app on an emulator or physical Android device.
Once installed, the application can be used to explore images from the Unsplash API. The primary purpose of the app is educational, demonstrating the usage of Retrofit with Hilt and infinite pagination.
- Hilt: Dependency injection library.
- Retrofit: HTTP client for making API requests.
- Pagination:
androidx.paging:PagingSource
for infinite scrolling. - Glide: Image loading library.
- Navigation:
androidx.navigation:navigation-fragment-ktx
andandroidx.navigation:navigation-ui-ktx
. - Architectural pattern: Monolith.
- Code Readability: code is easily readable with no unnecessary blank lines, no unused variables or methods, and no commented-out code, all variables, methods, and resource IDs are descriptively named such that another developer reading the code can easily understand their function.
Anyone can contribute by creating a pull request with changes. Contributions are welcome, although the app is primarily for educational purposes.
This project is inspired by the ImageSearchApp by Coding in Flow.
This project does not have an intentional license.