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

Unconventional Android v2

Unconventional Android v2

Android presentation given at Boise Code Camp 2015.

To get the most out of this presentation, follow along with the tags on GitHub: https://github.com/codeprogression/bcc-android-2015

Richard Cirerol

March 21, 2015
Tweet

More Decks by Richard Cirerol

Other Decks in Programming

Transcript

  1. Welcome to Unconventional Android version 2. Why V2? Well, I

    gave a similar talk last year. I updated it and rev'd it for you. So if you saw my talk last year, don't fret - I have a bunch of new content here. Unconventional Android v2 | Richard Cirerol | @codeprogression
  2. I work for a company in the San Francisco Bay

    Area called Vertigo. Vertigo is a really cool place to work. I get to write Android applications for some pretty high-profile clients. Unconventional Android v2 | Richard Cirerol | @codeprogression
  3. We've done apps for NBC Universal (SyFy, USA, and other

    networks), Microsoft, Radio Disney, GoPro, HBO, Google and more. In addition to Android, we do apps for iOS, Windows, Windows Phone, XBox, Playstation, Roku, and we even do websites. Unconventional Android v2 | Richard Cirerol | @codeprogression
  4. (psst! we're hiring!) Oh! Did I mention we are always

    looking for developers and designers? And we are a primarily-remote workforce. Unconventional Android v2 | Richard Cirerol | @codeprogression
  5. DEMO Tags: - 01_start: Get a list of movies -

    02_grid_layout: Grid w/ poster art (bad perf) - 03_picasso: Use picasso - 04_detail: Update detail page Unconventional Android v2 | Richard Cirerol | @codeprogression
  6. The Three Terrors of the Fire Swamp Unfortunately, we've wandered

    right into the Fire Swamp Unconventional Android v2 | Richard Cirerol | @codeprogression
  7. Three Terrors Bloat In the main activity, we can't see

    at a glance what is happening because we are doing too many things here. Same thing with our MovieActivity and Movie View Holder. We have repeated code and misplaced code. How do we tackle bloat? Unconventional Android v2 | Richard Cirerol | @codeprogression
  8. The SOLID Principles 4 Single Responsibility 4 Open-Closed 4 Liskov

    Substitution 4 Interface Segregation 4 Dependency Inversion Unconventional Android v2 | Richard Cirerol | @codeprogression
  9. DEMO Applying Clean Code Principles Tags: - 05_refactor: Move poster

    uri generation - 06_custom_view: Create custom views Using some clean code principles, we've made the code easier to read and componentized. Unconventional Android v2 | Richard Cirerol | @codeprogression
  10. Are singletons bad? I don't think singletons are bad. But,

    I do think they should be scoped and their accessors limited. Unconventional Android v2 | Richard Cirerol | @codeprogression
  11. Now you may have heard that Google advises against dependency

    injection on Android. But... Unconventional Android v2 | Richard Cirerol | @codeprogression
  12. Dependency Injection Dagger 2 4 http://github.com/google/dagger 4 http://google.github.io/dagger/ ...they are

    actively developing Dagger 2 for use in Android as well as server projects Unconventional Android v2 | Richard Cirerol | @codeprogression
  13. Dagger 1 still has reflection components Dagger 2 is 100%

    code generation Unconventional Android v2 | Richard Cirerol | @codeprogression
  14. Three Terrors Asynchronicity Thread - Handler - Message - Bus

    AsyncTask - Intent Service - Callbacks So many ways to handle asynchronicity. They all have their place and they all have their drawbacks. Unconventional Android v2 | Richard Cirerol | @codeprogression
  15. Functional Reactive Programming Over the last couple years, functional reactive

    programming has been coming into its own. You may know this better as... Unconventional Android v2 | Richard Cirerol | @codeprogression
  16. Functional Reactive Programming Reactive Extensions Reactive Extensions and Android has

    its own version called... Unconventional Android v2 | Richard Cirerol | @codeprogression
  17. Functional Reactive Programming RxAndroid https://github.com/ReactiveX/RxAndroid RxAndroid - which is an

    extension of RxJava that has some Android-specific APIs Unconventional Android v2 | Richard Cirerol | @codeprogression
  18. Working with HTTP in Android 4 AndroidHttpClient (DEPRECATED) 4 DefaultHttpClient

    (DEPRECATED) 4 UrlConnection 4 OkHttp Unconventional Android v2 | Richard Cirerol | @codeprogression
  19. DEMO Using RxAndroid and OkHttp Tags: - 08_okhttp - 09_rx

    Unconventional Android v2 | Richard Cirerol | @codeprogression
  20. Boilerplate Code 4 Sucks away at your life 4 Impedes

    readability Unconventional Android v2 | Richard Cirerol | @codeprogression
  21. Boilerplate Code 4 Sucks away at your life 4 Impedes

    readability 4 Obscures intention Unconventional Android v2 | Richard Cirerol | @codeprogression
  22. DEMO Removing Boilerplate Code Tags: - 10_inject: Butterknife and Dart

    - 11_codegen: Lombok, Parceler Unconventional Android v2 | Richard Cirerol | @codeprogression
  23. Vertigo is always looking for the best and brightest! Unconventional

    Android v2 | Richard Cirerol | @codeprogression