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

Android Engineering for Scale

Android Engineering for Scale

Droidcon London 2014 & Droidcon NYC 2015

Jamie McDonald

October 31, 2014
Tweet

More Decks by Jamie McDonald

Other Decks in Programming

Transcript

  1. None
  2. Android Engineering for Scale Jamie McDonald

  3. What is scale? In the context of mobile development title,

    date, 01 of 10
  4. Subtitle 4M Android downloads / month 175M monthly listeners title,

    date, 01 of 10
  5. title, date, 01 of 10

  6. title, date, 01 of 10 Codebase

  7. Ball of Mud title, date, 01 of 10

  8. Layered Architecture title, date, 01 of 10

  9. Featurised Architecture title, date, 01 of 10

  10. Layers

  11. Feature Packages

  12. Feature Packages STREAM StreamAdapter StreamFragment StreamModule StreamOperations StreamStorage StreamItemPresenter

  13. Lava Layers title, date, 01 of 10 “Successive, well intentioned,

    changes to architecture throughout the lifetime of an project can lead to a fragmented and hard-to- maintain code base” The Lava Layer Anti-pattern
  14. SPOCCER Screen Presenter Operations Controller Command EntityState Repository

  15. Subtitle Reactive Programming title, date, 01 of 10 Rx

  16. Branches title, date, 01 of 10 <<new component>> branch <<old

    component>> master <<old component>> origin/master
  17. master Branch by Abstraction title, date, 01 of 10 abstraction

    layer <<new component>> <<old component>> Martin Fowler: Branch by Abstraction
  18. master Branch by Abstraction title, date, 01 of 10 abstraction

    layer <<new component>> Martin Fowler: Branch by Abstraction
  19. master Branch by Abstraction title, date, 01 of 10 <<new

    component>> Martin Fowler: Branch by Abstraction
  20. master Trunk-based Development title, date, 01 of 10 feature-B .isEnabled()

    .isEnabled() feature-A .isEnabled() feature-C Trunk-based Development
  21. if (flags.isEnabled(Feature.BRAND_NEW_FEATURE)) { return newThing; } else { return oldThing;

    } title, date, 01 of 10 Feature Flags
  22. Modules title, date, 01 of 10 MAIN REPO SINGLE REPO

    ANDROID-KIT PROPELLER LIGHTCYCLE SKIPPY PLAYER
  23. Users title, date, 01 of 10

  24. Subtitle End-to-End Development title, date, 01 of 10

  25. Android iOS SoundCloud API

  26. API Mobile Mobile API Android iOS

  27. Subtitle title, date, 01 of 10 { "id":612849, "kind":"user", "permalink":"bazan",

    "username":"David Bazan", "uri":"https://api.soundcloud.com/users/612849", "permalink_url":"http://soundcloud.com/bazan", "avatar_url":"https://i1.sndcdn.com/avatars-000030728315- oe5uld-large.jpg?e76cf77", "country":"United States", "first_name":"David", "last_name":"Bazan", "full_name":"David Bazan", "description":"Known for his work fronting the enigmatic rock band Pedro the Lion, David Bazan\u2019s emotionally charged narratives, eye for telling detail, and mournful voice have more in common with J.D. Salinger\u2019s \u201cNine Stories\u201d or Flannery O\u2019Connor\u2019s \u201cWise Blood\u201d than with the usual lyrical slant of popular music. Bazan is a gifted storyteller, weaving parables of spiritual conflict, suburban ennui, and personal surrender into magnetic, well-crafted songs.\r\n\r\nHis debut solo full-length album, Curse Your Branches (out now on Barsuk), is a masterwork by a modern American poet at the height of his powers. Paste Magazine called him one of the \u201c100 Best Living Songwriters\u201d. This record is the deepest and most explicit exploration of his struggles with faith and a meditation on all things passed between the generations.", "city":"Seattle", [...] } { "collection":[ "hip hop", "chill", "electronic", "deep house", "party", "love", "rap", "happy", "study", "techno", "indie rock", "dubstep", "r&b", "relax", "country", "pop", "edm", "reggae", "house", "workout", "soundtrack", "reggaeton", "piano", "dance", "remix", "alternative", "summer", "instrumental", "rock", "morning", "funk", "classical", [...] } SoundCloud API Mobile API
  28. Staying Connected

  29. Team title, date, 01 of 10

  30. Mobile Team Other Engineering Android iOS Platform Teams

  31. Feature Teams Core Engineering Android iOS

  32. Core Engineering Android iOS Feature Teams

  33. title, date, 01 of 10

  34. title, date, 01 of 10

  35. Enabling Involvement

  36. Subtitle Collective Values title, date, 01 of 10

  37. title, date, 01 of 10 Pairing & Pull Requests

  38. title, date, 01 of 10 ACCEPTANCE TEST UNIT TEST CODE

  39. Subtitle title, date, 01 of 10 @Inject @LightCycle ActionBarUtil actionBarUtil;

    @Inject @LightCycle PlayerController playerController; public MainActivity() { [...] } Unit Testing
  40. title, date, 01 of 10 Acceptance Testing

  41. Release Train title, date, 01 of 10 BETA 257 258

    259 258-beta 259-beta RELEASE
  42. title, date, 01 of 10 UNIT TESTS BUILD PROMOTE ACCEPTANCE

    TESTS Continuous Integration
  43. title, date, 01 of 10 Featurised, layered architecture Shared practices:

    reactive programming Feature teams & end-to-end development Shared values: testing Trunk-based development Summary
  44. soundcloud.com/jobs Thank you, NYC!