Sample Android app that I use as a reference for my new Android projects. It demonstrates the architecture, tools and guidelines that I use when developing for the Android platform:
##Third Party Libraries & tools included
- Support Library
- Recycleview & Cardview
- Material design support
- Android Transition Framework
- Palette support
- Support annotations
- RxJava/ RxAndroid
- Retrolambda
- Dagger 2
- Retrofit2
- Glide or Picasso
- ButterKnife
- Otto event bus
- Latest Android SDK Tools and build tools.
- Android 6.0 (API 23) .
- Clean Architecture is :
- Independent of UI
- Independent of Frameworks
- Independent of any agency externe
- Independent of Database
- Testable
Read more here
This project follows Android architecture guidelines that are based on MVP (Model View Presenter). Read more about them here.
new-structure
├─ library-foobar
├─ app
│ ├─ libs
│ ├─ src
│ │ ├─ androidTest
│ │ │ └─ java
│ │ │ └─ com/abderrazak/recycleviewcardview
│ │ ├─ test
│ │ │ └─ java
│ │ │ └─ com/abderrazak/recycleviewcardview
│ │ └─ main
│ │ ├─ java
│ │ │ └─ com/abderrazak/recycleviewcardview
│ │ ├─ res
│ │ └─ AndroidManifest.xml
│ ├─ build.gradle
│ └─ proguard-rules.pro
├─ build.gradle
└─ settings.gradle
abderrazak.com.recycleviewcardview
├─ data
│ ├─ local
│ ├─ model
│ └─ remote
├─ service
├─ ui
│ ├─ main
│ ├─ detail
│ └─ etc..
├─ util
└─ views
├─ adapters
└─ widgets
####Gains and Benefits
By looking at the structure you can already tell what the app is all about (figure above);
- Higher modularity;
- Easier code navigation;
- Higher level of abstraction;
- Separates both features and layers;
- More readable and maintainable structure;
- More cohesion;
- Much easier to scale;
- Less chance to accidentally modify unrelated classes or files;
- Much easier to add or remove application features;
- And much more reusable modules.
check this
Imagine you have to implement a main screen.
-
Create a new package under
ui
called main. -
Create an new Activity called
MainActivity
. You could also use a Fragment. -
Define the view interface that your Activity is going to implement. Create a new interface called MainView. Add the methods that you think will be necessary,
e.g. showDialog()
-
Create a MainPresenterImpl class that implement MainPresenter.Implement the methods in MainPresenter that your Activity requires to perform the necessary actions,
e.g. setItems(List<Movie> movieItems)
. -
Create a MainPresenterTest and write unit tests for
e.g. setItems(List<Movie> movieItems)
. Remember to mock the MainView. -
Make your MainActivity implement SignInMvpView and implement the required methods like showDialog() In your activity, inject a new instance of MAinPresenter and call
presenter = new MainPresenterImpl(this)
from onCreate andpresenter.onDestroy()
from onDestroy(). Also, set up a click listener in your button that calls presenter.sortList().
Check my post here
- Implement SQlBrite
- Add Paralax to thumbnail (Parallax Recycleview)
Include those libraries :
- recyclerview-animators
- FAB menu
- custom snakbar
- FAB toolbar
- FAB transition
- Material spinner
- CircularImageView
- Drag Recycle
- Parallax Recycleview
- FAB Progress
- Material Preference
- Retainable Tasks
- material intro
- MaterialShowcaseView
- Boot Animation
- Sharing using NFC
- Functional tests with Espresso
- Robolectric
- Mockito
- Checkstyle, PMD and Findbugs for code analysis
Author: Abderrazak LAANAYA