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

Working Effectively with Android Legacy Code

Working Effectively with Android Legacy Code

Android developers face a tough challenge when working with legacy code including God activities, code coupling and issues integrating new features, to name just a few. What other blockers are there to working with legacy code and what are the solutions to such challenges?

Avatar for ExpensiveBelly

ExpensiveBelly

May 10, 2016

Other Decks in Programming

Transcript

  1. • Rewrite the app from scratch • Maintain the current

    app • Lose rounds of testing • Last resort Option One
  2. Who should I ask about this code? • Knowledge map

    showing the main developer (indicated by colour) of each module.
  3. • Many different implementations • https://github.com/android10/Android-CleanArchitecture • https://github.com/Karumi/Rosie • https://github.com/PaNaVTEC/Clean-Contacts

    • https://github.com/Karumi/KataContactsJava • https://github.com/flipper83/protohipster • Blogs • https://www.novoda.com/blog/hexawhat-architecture/ • http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ • https://medium.com/@dmilicic/a-detailed-guide-on-developing-android-apps-using-the- clean-architecture-pattern-d38d71e94029#.hq96s2jxg How to do this in Android
  4. Java module. Implementation agnostic. Domain objects, business logic. Modules Android

    application module. Implementation of the View interfaces. Activities, fragments, custom views, etc. Android library. Network implementation. Storage implementation, etc.
  5. • Quicker UI development • No dependency from the server

    • Happy and unhappy path • Better demos Goals: Offline Mode
  6. • Make good use of continuous integration tools • Find

    bugs as soon as possible Goals: High Code Coverage
  7. • Unit tests – JUnit, Mockito • Integration tests –

    MockWebServer • UI Test – Espresso Test Frameworks
  8. • Refactor in baby steps • Continous delivery • Accurate

    delivery estimations • Quality above quantity Best Practices
  9. Best Practices • Package by feature • Avoid cyclic dependencies

    • Classes that are used together are packaged together • Classes that change together are packaged together
  10. Katas • The Gilded Rose • Kata Mars Rover •

    Kata Potter • Bank Kata (Sandro Mancuso) • Kata Contacts (Karumi) • Super Heroes (Karumi) • Novoda Dojos
  11. Londroid Book Club The plan: • One book • Six

    weeks • One meet up To join, contact me on: @ExpensiveBelly or [email protected]