This app consumes data from the Rick & Morty API. The app is built using Kotlin and encompasses the Clean Architecture principle with MVVM approach and Jetpack libraries.
You can download the test apk here - Rick & Morty.
Wubalubadubdubbb!! π€πΎπ€πΎ
To setup the project in your machine
- Clone the repo
foo@bar:~$ git clone https://github.com/tirgei/rick-and-morty.git
- Set the BASE_URL in the
local.properties
file.
You can then import the project to your Android Studio
The app is divided into 3 modules, namely:
- Presentation (app)
- Data
- Domain
This approach is guided by the clean architecture approach which advocates for clear abstraction of the flow of data from the business logic to the presentation framework dealing with displaying data to the user.
The app
module contains the UI and navigation frameworks and also deals with instantiation of DI
components for the app. DataBinding is used to render data to the UI while
the ViewModel provides a link to the data
module
via the respective UseCase s.
The data
module deals with loading data from the sample response server. The app is persisted to local cache using Room.
cache
package - contains classes dealing with offline persistenceremote
package - contains classes dealing with fetching data from the API.
The domain
module mainly deals with the model classes which presents the data being used across both the
presentation
module and the data
module.
It defines the UseCase(s) which handle the flow of data from the Repository layer to the ViewModel. It also defines
the Repository interfaces which the data
module implements to provide data access.
Libraries used in the app include:
- Jetpack - Jetpack Components
- Dagger Hilt - Dependency Injection framework
- Coroutines - Framework for asynchronous processing in Kotlin
- Retrofit - Types-safe HTTP client for Android
- Timber - Logging Library
- Glide - Image loading & caching library
- Lottie - Animation library client for Android
For testing, the following libraries are included:
- JUnit - Framework to write tests
- Mockito - Testing mocking framework
- Truth - Assertions library by Google
- Espresso - Framework to write UI tests
Characters | Character Details |
---|---|
MIT License
Copyright (c) 2021 Vincent Tirgei
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.