A sample app that demonstrates usage of Retrofit Adapters to handle api response and exceptions within a clean architecture app.
- Following Clean Architecture.
- MVI Architecture.
- Repository Pattern.
- Mapper.
- Use Cases.
- Applying SOLID principles, each class has a single job with separation of concerns by making classes independent of each other and communicating with interfaces.
- Using Kotlin-KTS & Gradle Version Catalog to handle project dependencies.
- ViewModel : UI related data holder, lifecycle aware.
- Flow & StateFlow : Build data objects that notify views when the underlying database changes.
- KotlinCoroutines : For managing background threads with simplified code and reducing needs for callbacks.
- NavigationComponent : For navigation graph for navigating and replacing screens/fragments.
- MaterialDesign : Use material design components in XML Design.
- ViewBinding : Allows to more easily write code that interacts with views and replaces
findViewById
. - Dagger-Hilt : For dependency injection. Object creation and scoping is handled by Hilt.
- Retrofit2 & OkHttp3 : To make REST requests to the web service integrated.
- Gson : For parsing and serializing objects.
- JUnit : For unit testing.
- KotlinFixture : For creating dummy objects for unit testing.
- app : The main app module, contains splash screen and handle navigation across the app.
- core:network : Handles network calls with it's errors.
- core:ui : Contains classes related to UI like BaseActivity and BaseFragment and other useful ui extensions.
- core:utils : Contains utility classes and some exceptions related to business usage.
- feature-home : Contains data, domain, presentation for home feature.
- Following official kotlin code style
- Here are some useful Gradle commands for executing this example:
./gradlew clean
- Deletes build directory.
- Just fork this repository and contribute back using pull requests.
- Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed .
- Support it by clicking the ⭐ button on the upper right of this page. ✌️
If this project help you reduce time to develop, you can give me a cup of coffee :)
Copyright (C) 2024 MINA MIKHAIL PRIVATE LIMITED
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.