Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components. The data are fetched from LondonTheatreDirect API. 🎭

Overview

Icon

Theatre

Pet project using Clean Architecture + MVVM + Reactive Extensions + Android Architecture Components.
The data is fetched from LondonTheatreDirect API.

The main purpose is using the latest practices and libraries.


License Apache 2.0 minSdkVersion 16 compileSdkVersion 27 CircleCI codecov

Sample
*Data from London Theatre Direct
**UI inspired by Yaroslav Zubko's design

Architecture

Uses concepts of the notorious Uncle Bob's architecture called Clean Architecture.
The software produced by this architecture is going to be:

  • Independent of Frameworks.
  • Testable.
  • Independent of UI.
  • Independent of Database.

Clean

The Dependency Rule

The overriding rule of this architecture says that the source code dependencies always point inwards.
The outer tiers can only dependent of inner tiers. Therefore, the inner tiers know nothing about the outer tiers.
The more further you go through the concentric circles, the higher level the software becomes. Which means that the level of abstraction increases.

Entities

An entity is a set of data structures. These entities are the business objects of the application and encapsulate the most general and high-level rules, such as Event or Rating.

Use Cases

They are the operations of the application and may contain specific business rules.
This layer is isolated from database, UI, or any of the common frameworks.
All use case classes extends UseCase abstract class that sets up the schedulers of Reactive Extensions.

Adapters

It is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the UI or Database.
It is this layer that will wholly contain the ViewModels of MVVM architectural pattern.
The models are likely just data structures that are passed from the view to the use cases, and vice versa.
Similarly, data is converted, in this layer, from the form most convenient for entities and use cases, into the form most convenient for whatever persistence framework is being used.

Frameworks

The outermost layer is composed of frameworks and tools such as the Database and the Android Framework.
The Repository pattern is used to encapsulate the details about caching mechanism.

The Dependency Inversion

In order to not violate the Dependency Rule, the Dependency Inversion principle must be used whenever complex data needs to be passed across a boundary to an inward layer. Instead of expecting and directly referencing a low-level component (e.g. as a function parameter), the high-level layer provides and references an interface that must be implemented and inherited from by the caller. This way, the conventional dependency relationship is inverted and the high-level layer is decoupled from the low-level component.

Inversion of Control

The Dependency Injection

To make the application more testable and avoid having to deal with object instantiations in many points, the Dependency Injection technique is used.

Dependency injection is one form of the broader technique of inversion of control. As with other forms of inversion of control, dependency injection supports the dependency inversion principle.

Dagger is the tool used for managing and injection of our dependencies.

Modules: WIP

Modules

Data

The LondonTheatreDirect API groups the data into:

  • System API: Obtain information about enum data types.

Since the data is basically static, a Repository with database caching is used by Gateway.

  • Inventory API: Obtain realtime information about events on sale, venues, prices and availability.

Due the data volatility, it is used a Repository that caches in memory.

Data

Presentation: WIP

Presentation

Credentials

Register your account here to get your developer key and put it into gradle.properties file

References

  • Android Clean Architecture Sample app that is part of a series of blog posts about how to architect an android application using Uncle Bob's clean architecture approach.
  • Android Architecture Blueprints Demonstrate possible ways to help with testing, maintaining and extending of an Android app using different architectural concepts and tools.

Libraries and tools used in the project

Android

  • Android Support Library Provides additional convenience classes and features not available in the standard Framework API for easier development and support across more devices.
  • Data Binding Write declarative layouts and minimize the glue code necessary to bind application logic and layouts.
  • Android KTX A set of Kotlin extensions for Android app development.

Architecture and Design

  • Android Architecture Components A collection of libraries that help you design robust, testable, and maintainable apps. Start with classes for managing your UI component lifecycle and handling data persistence.
  • Dagger A fully static, compile-time dependency injection framework for both Java and Android.

Reactive

  • RX Java A library for composing asynchronous and event-based programs using observable sequences for the Java VM.
  • RX Kotlin RxJava bindings for Kotlin.
  • RX Android RxJava bindings for Android.

View and Image

  • ConstraintLayout Allows you to create large and complex layouts with a flat view hierarchy (no nested view groups).
  • RecyclerView A flexible view for providing a limited window into a large data set.
  • Glide An image loading and caching library for Android focused on smooth scrolling

Data Request

  • Retrofit A type-safe HTTP client for Android and Java.
  • OkHttp An HTTP & HTTP/2 client for Android and Java applications.
  • Moshi A modern JSON library for Android and Java.

Persistence

  • Room The Room persistence library provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.

Debugging and tests

  • Stetho A debug bridge for Android applications.

TODO

Contributing

Contributions are always welcome!

Issues: Fell free to open a new issue. Follow the ISSUE_TEMPLATE.MD

Follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Merge with current development branch
  5. Push your work back up to your fork
  6. Submit a Pull request your changes can be reviewed (please refere the issue if reported)

Prevent code-style related changes. Format the code before commiting.

License

Copyright 2018 André Mion

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.
You might also like...
Create kotlin android project with one line of command.

README This is an android application template project built with kotlin language and some useful libraries. It provides a creator script to quickly c

Create kotlin android project with one line of command.

README This is an android application template project built with kotlin language and some useful libraries. It provides a creator script to quickly c

ForkTest - A Paper fork, using paperweight

ForkTest - A Paper fork, using paperweight This is an example project, showcasin

Android part of the  Android Studio(IntellijIDEA) OkHttp Profiler plugin
Android part of the Android Studio(IntellijIDEA) OkHttp Profiler plugin

OkHttpProfiler Android Library Created by LocaleBro.com - Android Localization Platform The OkHttp Profiler plugin can show requests from the OkHttp l

Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on
Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on

android-common-lib 关于我,欢迎关注 微博:Trinea 主页:trinea.cn 邮箱:trinea.cn#gmail.com 微信:codek2 主要包括:缓存(图片缓存、预取缓存、网络缓存)、公共View(下拉及底部加载更多ListView、底部加载更多ScrollView、

A Model-View-Presenter / Model-View-Intent library for modern Android apps

Mosby A Model-View-Presenter and Model-View-Intent library for Android apps. Dependency dependencies { compile 'com.hannesdorfmann.mosby3:mvi:3.1.1

dexposed enable 'god' mode for single android application.

What is it? Dexposed is a powerful yet non-invasive runtime AOP (Aspect-oriented Programming) framework for Android app development, based on the work

A small, yet full-featured framework that allows building View-based Android applications
A small, yet full-featured framework that allows building View-based Android applications

Conductor A small, yet full-featured framework that allows building View-based Android applications. Conductor provides a light-weight wrapper around

A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

This Project is Deprecated! Thanks to everybody who've used Android Priority JobQueue. It was designed in a world where there was no JobScheduler, RxJ

Comments
  • Want to understand it without RXJava

    Want to understand it without RXJava

    In the domain section, Rxjava is the thing which redirects the result from respective data source to corresponding presenter for success or Error

    So, I only want to understand how can I do it without RXJava, as. It will be great if you can provide me sample to do it without RXjava or how didi't worked

    question 
    opened by TheReprator 1
Owner
André Mion
🇧🇷 Android Engineer living in 🇵🇹 • Full time Husband and Dad • Occasionally Drummer and Inline Skater… I build mostly Android stuffs…
André Mion
A data-binding Presentation Model(MVVM) framework for the Android platform.

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED. As personal time contraints, I am currently unable to keep up. Please use official android da

RoboBinding open source 1.3k Dec 9, 2022
Rosie is an Android framework to create applications following the principles of Clean Architecture.

Rosie The only way to make the deadline—the only way to go fast—is to keep the code as clean as possible at all times. — Robert C. Martin in Clean Cod

Karumi 1.8k Dec 28, 2022
A full-featured framework that allows building android applications following the principles of Clean Architecture.

EasyMVP A powerful, and very simple MVP library with annotation processing and bytecode weaving. EasyMVP eliminates the boilerplate code for dealing w

null 1.3k Nov 19, 2022
🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )

JsonToKotlinClass Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to

Seal 2.8k Jan 3, 2023
Intellij Idea, Android Studio plugin for generating Kotlin data classes from JSON. Helps to avoid writing boilerplate code for model classes. Supports annotations for Gson, Moshi, Jackson.

JSONToKotlinClass Intellij Idea, Android Studio plugin. Plugin generates Kotlin data classes from JSON text. It can find inner classes in nested JSON.

Vasily 139 Dec 21, 2022
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
MVVM for Android

AndroidBinding MVVM for Android What's New Pre Compiled version available on root directory android-binding.gen.zip for activity/application template

Andy Tsui 350 Dec 17, 2022
MVVM framework for Android

RoboMVVM - MVVM Framework For Android RoboMVVM is an open source library that facilitates the use of the MVVM pattern in Android apps. The MVVM patter

Debdatta Basu 55 Nov 24, 2020
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:

Villains & Heroes Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information

André Mion 53 Jul 13, 2022
🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

?? AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android??

Pumpkin 325 Nov 22, 2022