Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
is too complex ▸ We have to rely solely on default constructors, rather than custom constructors ▸ Nested Fragments are prone to bugs and limitations. ▸ Hard to trace, hard to debug ▸ View controllers? Not easy to decouple views and models ▸ Fragment transactions is async - Unstable state ▸ Fragment recreation problem - Missing outer class
are UI screens, flow controls, and lifecycles ▸ Put everything in them (Nightmare!) ▸ The code is hard to trace and debug ▸ Strong connection to each other ▸ Hard to do unit test ▸ Mess up with the lifecycle ▸ Especially the next thing we are going to talk about..
COMBINED TOGETHER ▸ Android lifecycle is too complex, especially with async tasks ▸ Android async tasks are hard to write and manage when firing many RESTful requests
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
software engineering, author, public speaker ▸ Publications ▸ (2002). Agile software development: principles, patterns, and practices. ▸ (2009). Clean code: a handbook of agile software craftsmanship. ▸ (2011). The clean coder: a code of conduct for professional programmers.
Independent of Frameworks ▸ Testable ▸ Independent of UI ▸ Independent of Database ▸ Independent of any external agency ▸ Independency of each level (Decoupled, Replaceable)
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.
functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.
functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data ▸ Much easier for multithreading programming
movement event (Position data stream) ▸ 20:01:35:000 at (200, 200) ▸ 20:01:35:001 at (201, 200) ▸ 20:01:35:002 at (202, 200) ▸ 20:01:35:003 at (203, 200) ▸ 20:01:35:004 at (204, 200) ▸ …
mouse move ▸ To receive current position ▸ Become a mouse movement event ▸ Reactive to mouse movement event ▸ To change corresponding UI ▸ For example: ▸ Display hint at certain position ▸ Open a menu at certain position
reactive programming (FRP) is a programming paradigm for reactive programming (asynchronous dataflow programming) using the building blocks of functional programming (e.g. map, reduce, filter). ▸ FRP has been used for programming graphical user interfaces (GUIs), robotics, and music, aiming to simplify these problems by explicitly modeling time.
issue with anonymous classes is that if the implementation of your anonymous class is very simple, such as an interface that contains only one method, then the syntax of anonymous classes may seem unwieldy and unclear ▸ Lambda expressions enable you to do this, to treat functionality as method argument, or code as data
automatically determines (based on the lifecycle sequence itself) when the source should stop emitting items ▸ The easy way ▸ extends Rx-Activity or Rx-Fragment family ▸ Observable.bindToLifecycle()
power of ReactiveX and FRP on Android ▸ RxAndroid ▸ Android Thread controller for RxJava ▸ RxLifecycle ▸ RxJava Helper for complex Activity and Fragment lifecycle
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
Don’t need to write a lot of boilerplate codes ▸ Easy and flexible to use ▸ Allow to plugin your modified HTTP client, JSON converter, and etc. ▸ Only need to define the API interface to work
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
those boilerplate codes ▸ project/app/build/intermediates/classes/debug/ com.example.application/databinding/ MainActivityBinding.java ▸ Two-way binding with Observable objects ▸ Easy to test with ViewModel ▸ Mock test data in ViewModel
Challenges in Android Client App Development ▸ Uncle Bob: Clean Architecture ▸ Everything is a Stream - ReactiveX to the Rescue! ▸ The Most Powerful REST Client Library - Retrofit ▸ Android MVVM Pattern - Data Binding Support Library ▸ The Combined Solution - Demo and Recap
COMBINED TOGETHER ▸ Android lifecycle is too complex, especially with async tasks ▸ Android async tasks are hard to write and manage when firing many RESTful requests