4

I am interested in exploring good architectural patterns for Android applications.

I made several experiments with VIPER and generally Clean Architecture approaches but I would like to get some good material/ideas to investigate from you dear SO fellows.

Here are some important points that should be reflected:

  1. It should help handle routing/navigation in a typical single activity/multiple fragments app

  2. It should clearly separate which components/layers will run on background threads and which on the main thread and to communicate between layers (observer pattern, eventbus or whatever)

  3. It uses limited amount of third party libraries and if it does please indicate the pros and cons (like Dagger for Dependency Injection for example)

  4. It helps mantaining orthogonality on the long run while adapting/extending the app. A change in one module should affect the minimum amount of components without having cascading effects because components are thigh coupled.

  5. It would be great to have a look to real examples/prototypes on github or wherever to keep it real and practical without being too much on the academic side ;-)

Thanks in advance for any cool ideas/patterns

ctarabusi
  • 343
  • 1
  • 11
  • 1
    This is not an appropriate question for SO. From the [help center](http://stackoverflow.com/help/dont-ask): _"You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page.... Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much._" – Ted Hopp Apr 19 '16 at 19:14
  • A vast topic, check some [links](http://mgolokhov.github.io/architecture/) – Maxim G Apr 19 '16 at 19:25

1 Answers1

2

You can use MVP + Repository pattern, I am using it in my project and the code is more cleaner, loosely couple, there are well separated layers. You can add Dagger to dependency injections and RxAndroid to asynchronous task.

This are the best links that I found and helped me to learn this architecture:

http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/

https://medium.com/android-news/android-architecture-2f12e1c7d4db#.bupsk0o2n

https://medium.com/@artem_zin/m-model-from-mvc-mvp-in-android-flow-and-mortar-bd1e50c45395#.uyij0tjgs

http://fahimk.github.io/2015/04/21/using-rxjava-with-mvp-to-handle-configuration-changes/

https://kmangutov.wordpress.com/2015/03/28/android-mvp-consuming-restful-apis/

https://github.com/sam33rdhakal/MVPandroid/tree/master/app/src/main/java/com/enepalichords/nepalichords

http://magenic.com/Blog/Post/6/An-MVP-Pattern-for-Android

You can find code in the above links and this is one of my projects used to learning purposes :

https://bitbucket.org/emaleavil/cheapshark/

There are many things to improve but I think that can you help to start, this project is unfinished, I'm so sorry.

emaleavil
  • 591
  • 7
  • 14
  • Yes I understand, this answer will do it. I was not aware of this SO rule to not allow open discussion, thanks – ctarabusi Apr 20 '16 at 07:32
  • I'm sorry. I didn't know that but it's impossible explain all the architecture pattern in a comment. – emaleavil Apr 20 '16 at 16:49