Skip to content

Modular Android architecture which showcase Kotlin, MVVM, Clean architecture, Dynamic feature module, Navigation, Paging, Dagger, RxJava, Retrofit, DataBinding, Espresso and Unit test.

Notifications You must be signed in to change notification settings

akarnokd/StarWarsSearch-RxPaging

 
 

Repository files navigation

StarWarsSearch-Paging

An Android Application interacting with Star Wars API. It enables users to search for Star Wars Characters and get their details from the Star Wars Universe.

Features

  • Modular Android App Architecture
  • Clean Architecture + MVVM Architecture + Repository design Pattern.
  • Jetpack Libraries and Architecture Component
  • Kotlin Gradle DSL

Architecture

Modular Android App Architecture presented in Google I/O’19, is a software design technique to separate functionality into independent, interchangeable modules so that each contains everything necessary to execute a specific functionality. Modular app architecture allows to be developed features in isolation, independently from other features.

Clean architecture helps organizing the project into different layers so that it's easy to understand, scale and debug when need arises. Clean architecture maximizes the usage of SOLID principles. SOLID design principles intended to make software designs more understandable, flexible and maintainable.

A single-activity architecture, using the Navigation component to manage fragment operations.

Android architecture components which is part of Android Jetpack to give the project a robust design, testable and maintainable.

Pattern Model-View-ViewModel (MVVM) facilitating a separation of development of the graphical user interface.

Modules

Modules are collection of source files and build settings that allow you to divide a project into discrete units of functionality. In this case apart from dividing by functionality/responsibility, existing the following dependence between them. The project is divided into 4 Modules :

App module

The :app module is an com.android.application, which is needed to create the app bundle. It is also responsible for initiating the dependency graph.

Core module

The :core module is an com.android.library for serving network requests. Providing the data source for the many features that require it.

Feature module

The :features_search module is an com.android.dynamic-feature is essentially a gradle module which can be downloaded independently from the base application module. It can hold code and resources and include dependencies, just like any other gradle module.

Common module

The :common module is an com.android.library only contains code and resources which are shared between feature modules. Reusing this way resources, layouts, views, and components in the different features modules, without the need to duplicate code.

Addenda

  • :app depends on :core and indirectly depends on :features_search by dynamic-features. It also depends on :common and :feature_search for instrumentation test using androidTestImplementation.
  • :features_search modules depend on :common, :core and :app.
  • :core and :common don’t have any dependency.

Testing

Testing is done in each layer includes Repository and UseCase in :core module as well as ViewModel in :features_search module. This is one of the advantages of Clean Architecture.

Libraries

  • Android Jetpack
    • Paging Library helps you load and display small chunks of data at a time. Loading partial data on demand reduces usage of network bandwidth and system resources.
    • ViewModel ViewModel is designed to store and manage UI-related data in a lifecycle conscious way. This allows data to survive configuration changes such as screen rotations.
    • DataBinding is a Library in the support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
    • LiveData is lifecycle-aware, meaning it respects the lifecycle of other app components updating app component observers that are in an active lifecycle state.
    • Navigation Android Jetpack's Navigation component helps you implement effective navigation.
  • Dynamic feature module allows you to separate certain features and resources from the base module of your app.
  • Dagger is a fully static, compile-time dependency injection framework for Java, Kotlin, and Android.
  • RxJava is a library for composing asynchronous code using observable sequences.
  • RxAndroid is a module that adds the minimum classes to RxJava to make writing reactive components in Android.
  • Retrofit is a Type-safe HTTP client for Android and Java and Kotlin by Square.
  • Moshi is a modern JSON library for Android and Java. It makes it easy to parse JSON format data.
  • OkHttp interceptor Logs HTTP requests and responses.
  • Material Design Build beautiful, usable products using Material Components for Android
  • JUnit4 Unit Testing
  • Mockito which is the most popular Mocking framework for unit tests written in Java as well as Kotlin.
  • Espresso Automated testing UI test

Licence

MIT License

Copyright (c) 2021 Mohammadali Rezaei

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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Modular Android architecture which showcase Kotlin, MVVM, Clean architecture, Dynamic feature module, Navigation, Paging, Dagger, RxJava, Retrofit, DataBinding, Espresso and Unit test.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%