Code Monkey home page Code Monkey logo

dagger2-clean-mvp-example's Introduction

Dagger2-CLEAN-MVP Example

Build Status

Sample project with the first steps of my approach to Android CLEAN architecture, based on elegant solutions from respected developers. Features a List of users, obtained from randomuser API. Some of the aspects covered on this project are:

  • Dependency Injection using Dagger2.
  • Elegant ListView RecyclerView implementation using Renderers.
  • View binding using Jake Wharton's ButterKnife 6.x (current is 8.x).
  • Image loading using picasso, round transformations using PorterDuff.
  • Creating an image cache with picasso.
  • Model-View-Presenter + Interactor + DataSource layers, with different DataSources:
    • a REST Api using retrofit
    • a local JSON file
    • a class generating mock instances
  • Code-style rules using checkstyle. This blogpost indicates how checkstyle has been imported
  • Android Unit testing using JUnit 4 and Mockito.
  • UI Testing using Espresso
  • Low-boilerplate MVP implementation using generics (splitted into Presenter / APresenter / APresenterImpl).
  • Travis CI integration including instrumentation tests ran on an AVD. see .travis.yml script

Screenshot

This project has taken the following talks, articles, and repos as inspiration (it wouldn't have been possible without them)

TODOs

  • A better Thread management to do heavier operations outside the UI Thread
  • RecyclerViews, Renderers2.0
  • More DataSources like parse, Google Cloud, Azure, protobuf...
  • Unit tests
  • UI tests
  • Refactor to add Repository layer
  • Refactor Presenter layer to make it testable with JUnit
  • Add retrofit2-based API layer, keeping the retrofit1 one
  • Redesign UI to a more attractive one

Developed By

Follow me on Twitter Find me on Linkedin
  • Sylvia Domenech

License

Copyright 2016 Olmo Gallegos Hernández

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.

Imagery

All icons & art were obtained from flaticon.com, an excellent resource for downloading icons under attribution. If you don't know it, I recommend you to have a look, and don't forget to credit the authors!

dagger2-clean-mvp-example's People

Contributors

voghdev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.