List Screen | Detail Screen
FetchLister is a dynamic Android project that leverages the latest technologies for efficient item listing and detailed item information retrieval. This ongoing sample project adheres to Google's recommended nowinandroid architecture. It harnesses the power of Jetpack Compose to deliver a sleek and user-friendly interface. The project is built with Hilt for dependency injection and Room for managing local database operations. FetchLister seamlessly blends modern architectural principles with cutting-edge tools, including Retrofit2 & OkHttp3 for GraphQL APIs, to provide a seamless item management experience.
- Android Studio
- Android Platform
- Minimum SDK level 24
- Target SDK level 33
- Kotlin (no Java or Groovy!)
- Jetpack Compose
- Navigation - to navigate between composables
- Compose Material - to use Material Design Components
- Compose UI - to interact with the device, including layout, drawing, and input
- Compose Runtime - Fundamental building blocks of Compose's programming model and state management
- Jetpack Compose - Coil - Image loading library for Android backed by Kotlin Coroutines.
Activity
- Coil - Image loading library for Android backed by Kotlin Coroutines.
- StateFlow for sharing states
- Hilt for dependency injection
- Retrofit2 & OkHttp3 - construct the REST APIs
- Room for local database
- MVVM/Clean Architecture
- Github
- GraphQL APIs
The home screen of the app displays a list of 20 Rick and Morty characters. Each item in the list includes the character's name, status, and species.
Upon tapping on a character, the app navigates to a detailed screen. Here, the character's image and comprehensive information about their location is displayed. This includes the name, type, dimension, and number of residents in that location.
The goals for the app architecture are:
- Readability: The code is designed to be easily comprehensible at a glance.
- Maintainability: The codebase is structured in a way that makes it straightforward to work on, even in the future.
- Extensibility: The architecture allows for the seamless addition of new features or making design adjustments.
- Follow the official architecture guidance as closely as possible.
- Easy for developers to understand, nothing too experimental.
- Support multiple developers working on the same codebase.
- Minimize build times.
The app follows the Offline-First architecture, ensuring that once data is loaded, it's cached locally. This approach prioritizes displaying cached data first, followed by fetching the latest data from the remote source. Additionally, the app provides offline access for browsing, and it alerts the user with a snackbar when there is no internet connection.
The app architecture has three layers: a data layer, a domain layer and a UI layer.
The architecture follows a reactive programming model with unidirectional data flow. With the data layer at the bottom, the key concepts are:
- Higher layers react to changes in lower layers.
- Events flow down.
- Data flows up.
The data flow is achieved using streams, implemented using Kotlin Flows.
Read more here:
- https://github.com/android/nowinandroid/blob/main/docs/ArchitectureLearningJourney.md
- https://github.com/android/nowinandroid/blob/main/docs/ModularizationLearningJourney.md
fetch_lister.webm
FetchLister using the Rick and Morty API for constructing GraphQL API.