After multiple variations and iterations of implementing the MVP pattern in various Android applications, I decided to explore implementing MVVM using the Android Data Binding library as the basis. The results have me in a state of near Android-coding-bliss.

Before walking you through the steps that I took to approach this nirvana, I want to share the goals that I had for this endeavor:

  • A MVVM unit should consist of nothing more of a ViewModel (VM), it’s state (M) and a bound layout resource file (V).
  • Each MVVM unit should be modular and nestable. A MVVM unit should be able to contain one or more child units, which in turn may contain their own children. …


Places and Navigation

Okuki provides a way to define and navigate your application’s view hierarchy in an abstract way, decoupled from your various Activity/Fragment/View implementations.
With Okuki, you can organize your application around a hierarchy of named Place classes. Each Place may be annotated to define its parent, establishing the hierarchy. Additionally each Place defines a type argument for a data payload it may carry when being requested:

@PlaceConfig(parent = KittensPlace.class)
public class KittensDetailPlace extends Place<Integer> {

public KittensDetailPlace(Integer data) {


In the above example, KittensDetailPlace is a descendant of KittensPlace, and carries an Integer payload. …

Image for post
Image for post

Several months ago, as a way to get myself up to speed with using and unit-testing RxJava, I developed and posted this reference application. I had ambitions of immediately following it up with a blog post, but I got distracted and I never got around to sharing it with anyone. So better late than never I suppose.

Use Case

The application is that of a metronome with the following features:

  • A core metronome “engine” which triggers “beat” events on a timed interval. …


Cain Wong

Code, music, kung fu… but mostly code

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store