Android Architecture Blueprints

Android Architecture Blueprints

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps

820df515de752bffa0ce2644a7927186?s=128

David González

March 16, 2017
Tweet

Transcript

  1. Android Architecture Blueprints A collection of samples to discuss and

    showcase different architectural tools and patterns for Android apps
  2. David González Software Engineer@ Help Scout - Google Developer Expert

    @dggonzalez
  3. Jose Alcérreca Stephan Linzner Natalie Masse Mustafa Kurtuldu David González

    Jorge Barroso (Karumi) Saúl Molinero Erik Hellman Florina Muntenescu Rainer-Lang Etienne Caron Ubiratan Soares Tomasz Rykała Andrew Brandon Gogetap Cesar Augusto Zapata Baldassarri Deividi Dmitriy Zaitsev Duong Quang Son Eugen Martynov Greg Pearce Kiran Rao Nikita Kozlov Ravindra Kumar Samuel Urbanowicz Shinya Fukuta Yigit Boyar h3r3x3 (you?)
  4. Beginner Intermediate Advanced Target Audience

  5. Blueprints is an architecture a testing project. • UI Testing

    as a Spec Fast, reliable and hermetic • Decent unit test coverage Mockito, MockableAndroidJar, no Robolectric, no powermock • Use Non-UI Android tests Test against real implementations, compatibility testing
  6. A to-do app

  7. todo-mvp/ - Basic Model-View-Presenter architecture todo-mvp-loaders/ - Fetches data using

    Loaders todo-mvp-contentproviders/ - Uses Content Providers todo-databinding/ - Uses the Data Binding Library todo-mvp-clean/ - Uses concepts from Clean Architecture todo-mvp-dagger/ - Uses Dagger2 for Dependency Injection todo-mvp-rxjava/ - Uses RxJava for concurrency and data layer abstraction dev-todo-mvvm-databinding/ - Model View View Model based on todo-databinding dev-todo-mvvm-rxjava/ - Model View View Model based on todo-mvp-rxjava todo-mvp-fragmentless/ - Uses Android views instead of Fragments todo-mvp-conductor/ - Single Activity + Conductor framework todo-mvp-tablet/ - Phone + Tablet version Stable In development External In review
  8. UI Testing as a contract

  9. None
  10. Travis

  11. circleci

  12. Firebase Test Lab

  13. Design decisions Flavors (mock/prod) Minifier / shrinker Fragments Simulated network

    calls
  14. Blueprints is a collection of samples platform for Android devs.

    • Learning • Outreach/discuss • Base for sample or template for app • GitHub cred ★★★★★
  15. How to use Blueprints

  16. Browse on GitHub github.com/googlesamples/ android-architecture

  17. Compare locally Diffs between branches are as small as possible

    $ git clone https://github.com/ googlesamples/ android-architecture.git $ git checkout todo-mvp $ git difftool -d todo-mvp-clean
  18. meld

  19. None
  20. todo-mvp

  21. todo-mvp-clean

  22. todo-mvp-contentproviders

  23. todo-databinding

  24. Findings Dex method count APK size IRRELEVANT (if you shrink)

  25. Dex count

  26. APK size

  27. None
  28. HELP! • Answer questions and reply to issues • Wiki

    and articles • Create samples (read guidelines!) • Become core maintainer (merge-master)
  29. Contribution examples

  30. V2: What is coming • Focusing on underlying patterns ◦

    MVVM, MVC, Redux, Flux… • Other apps, different spec • Improve platform for discussion
  31. Thank you! github.com/googlesamples/android-architecture David González @dggonzalez