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
ListViewRecyclerView implementation using Renderers. - View binding using Jake Wharton's ButterKnife 6.x (current is 8.x).
- Image loading using picasso, round transformations using PorterDuff.
- 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
- Simple MVP implementation without interfaces because Interfaces for presenters in MVP are a waste of time.
- Travis CI integration including instrumentation tests ran on an AVD. see .travis.yml script
This project has taken the following talks, articles, and repos as inspiration (it wouldn't have been possible without them)
- Jorge Barroso - Forgetting Android
- Pedro Vicente Gómez Sánchez - EffectiveAndroidUI
- Dependency Injection on Android - Pedro Gómez
- Dagger2 Example by David Lázaro
- Google's Dagger Example
- Antonio Leiva's MVP Example and Blog article
- protohipster - Jorge Barroso
- UpcomingMoviesMVP - Jose Luis Martín
- KataSuperHeroesAndroid - Karumi
- A better Thread management to do heavier operations outside the UI Thread
- RecyclerViews, Renderers2.0
- 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
- Olmo Gallegos Hernández - @voghDev - mobiledevstories.com
- Sylvia Domenech
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.
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!