uziassantosferreira / Reddit

Simple project with clean architecture, android lifecycle, paging library consuming reddit api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supported language:

Summary

  1. Introduction
  2. Architecture
  3. TODO
  4. License

Reddit Application

The requirements raised for this assignment shall test concepts of:

  1. Architectural design for Android Applications;
  2. Ability to communicate with complex end-points, parsing JSON responses and update UI;



Land Support



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.

  • UI - contains all UI related classes (Activities, Fragments, Adapters, etc.).
    This layer is using Jetpack's Navigation API to implement the "single activity" approach for the navigation flow.
  • BuildSrc - contains all gradle dependencies Better Management
  • Presentation - once this project is folowing (or trying to) the MVVM pattern, this layer is using View Model library to keep data between config changes.
    To expose observable data from the View Models, this module is using LiveData.
    This layer is using Lifecycle library in order to tie the View Model with UI lifecycle (in some cases).
  • Domain - in this module are declared the application's use cases.
  • Data - declares the basic operations that must be provided by the application's repository and the basic data classes used as DTO with implementation to get a remote data in the API Reddit.

One of the most importants gains that the Clean Architecture brings to the project is the fact that all business logic gets isolated, it means, all code worthy to be tested is well encapsulated on classes with low dependency on OS components. This pattern alied with a Dependency Injection Container and Mock Frameworks (such as Mockito and Junit allows the developer to take full advantage of Unit Tests.

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.
  • Custom tab Library Chrome Custom Tabs give apps more control over their web experience, and make transitions between native and web content more seamless without having to resort to a WebView.

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.

Dependency injection

  • Koin A pragmatic lightweight dependency injection framework for Kotlin developers.

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 Kotlin.
  • OkHttp An HTTP & HTTP/2 client for Android and Kotlin applications.
  • Gson A Converter which uses Gson for serialization to and from JSON..

Tests

  • Junit) JUnit is a unit testing framework for the Java programming language.
  • Mockito A small library that provides helper functions to work with Mockito in Kotlin.
  • kluent Kluent is a "Fluent Assertions" library written specifically for Kotlin.
  • kakao Nice and simple DSL for Espresso in Kotlin

TODO

Copyright 2018 Uzias Santos Ferreira

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.

About

Simple project with clean architecture, android lifecycle, paging library consuming reddit api


Languages

Language:Kotlin 100.0%