Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Architecting Modern Android Apps

Architecting Modern Android Apps

Presentation for STHLM Android Meetup @ Screen Interaction.

What about internal app architecture? Should we really let the framework dictate how we architect our applications?

This is a story of how we rose from chaos by ignoring Android conventions and migrated to use-case driven architecture. This presentation will be about the EBI architecture (entities, boundaries and interactors) and model, view, presenters (MVP).

Full source code available at: https://github.com/wejeus/modern-android-architecture-demo

Samuel Wejéus

April 28, 2016
Tweet

Other Decks in Programming

Transcript

  1. Architecting Modern Android Apps Samuel Wejéus - Tech Lead Screen

    Interaction http://www.isalldigital.com @isalldigital
  2. 00 01 02 03 04 05 06 07 Intro How

    we used to do stuff What is wrong with that? Could we do it any other way? Overview: EBI Overview: MVP Practical implementation Conclusions Architecting Modern Android Apps
  3. The Framework Dictates! • The implementation should just be a

    detail! • A good architecture lets you maximise the number of decisions NOT made • Hard to test
  4. Good Architecture Should Encourage • Structure • Less framework dependencies

    • Robust independent deployable modules • Easy testing
  5. public class MyActivity extends Activity implements Contract.View { @Override private

    void setLoginEnabled(boolean enabled) { mLoginButton.setEnabled(enabled); } … } public class Presenter implements Contract.Action { @Override private void onSomeAction() { if (someConstraintIsValid) { mView.setLoginEnabled(true) } } … }
  6. Conclusions • Focus on use-cases • Strong boundaries between components

    • Structure our app into layers • Unit-test all relevant parts of our app • Clean architecture that is easy to work with
  7. Thank you! Samuel Wejéus - Tech Lead Screen Interaction http://www.isalldigital.com

    @isalldigital https://github.com/wejeus/modern-android-architecture-demo