DAG — Directed Acyclic Graph

When it comes to Dagger for Android Developer, the first question that needs to learn or clarify is Dependency Injection(DI).

Here are some examples of the Dependency Injection in the real life.

Humans cannot live without Water.
NBA cannot play without Teams.
Tesla cannot run without Battery.
A guitar cannot play without Strings.
A car cannot run without an Engine.
An airplane cannot fly without Gas.

A cannot do something without B, which means whenever A is being used or exist. B will always be there like a shadow. …

There are a lot of kinds of cloud services, such as Google Cloud, Microsoft Azure, Amazon Web Services, IBM Cloud, etc. But most of them need to be charged after the free trial. So this part is going to introduce Heroku and deploy those projects I created in previous sections.

Long story short, Heroku is a free service that provides complete documents. Moreover, it supports several kinds of languages and frameworks. Their dev center is very clear and friendly. Just follow their guide and you are able to deploy something on the Heroku cloud.

Note: Here is the pricing page

There are several languages and popular frameworks that could help backend developers to create RESTful API, such as Java/Kotlin with Spring, C# with ASP.NET, Python with Flask/Django, Go with Golang, PHP with Laravel, Node.js with Express.js, etc. The most important thing is all of those popular frameworks could solve the requirements of most web applications.

The reason why I choose Node.js is just that is very easy to learn. When it comes to performance issues, this article may help.

Node.js and Express.js

Here is the official website of Node.js, just click the download to install the Node.js and npm.

Express.js is the framework…

So far, we already create an empty data sheet in PostgreSQL database. Next challenge we will solve is to put some data in that datasheet. There are several ways to put data into the database. In this section, I choose to use Python and Scrapy framework to crawl data and insert into datasheet.

The first step is to get everything we need.

  1. Python — High-level programming language, easy to use, easy to learn.
  2. Scrapy — Powerful web crawler framework which is base on python.
  3. beatifulsoup — Pulling data out of HTML and XML files. …

There are a lot of popular databases; such as MySQL, MSSQL, PostgreSQL, MongoDB, OracleDB etc. Each of them has their advantage and disadvantage. But the basic concepts of SQL(Standard Query Language) are the same.

I will create a database with some data sheets with PostgreSQL in this section.
PostgreSQL is an open source object-relational database. And it not only easy to implement, but also flexible.

We could choose several ways to install PostgreSQL. The document already wrote everything. Just follow the step and it will install to your computer successfully. I personally choose brew to install it.


$ brew install…

This series are recording every steps that how I build up a backend service with two programming languages, two frameworks, several libraries and a free could service. I will list down the main languages, frameworks and libraries.

There are too many things to introduce, so I will just write down something important thing that we should know from wikipedia or their document.

Node.js, Express.js, KNEX.js

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.

Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

How Retrofit2 work with ReactiveX?

I don’t remember how long, but I think it is about three or four years ago. Retrofit2 didn’t provide function for Reactive Programming. But thanks for Jake Wharton who is contribute a lot for Android developer society. He not only create RxJava Adapter for Retrofit2 but also design RxBinding for Android UI widgets.

About two years ago, RxJava Adapter already merge in the Retrofit2 project to let developers use this more easier. We just need to import it with this line and we could do Observable stuff to our data model.

implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit2_version"

I am going to use GitHub API…

Start coding with ReactiveX in Android

We could start coding after we have the basic concept of Reactive Programming and the libraries of ReactiveX. I will introduce the most commonly and widely use function in this part.

Before we start, remember the steps below. Making sure we follow those rules and execute them every time when we coding with RxJava. Once knowing the basic, it is easy to do some refactors to our code.

  1. Create Observable
  2. Create Observer
  3. Connect Observable and Observer with Subscribe

Adding Dependencies

We need to add the RxJava, RxKotlin and RxAndroid dependencies to our projects build.gradle and sync. …

What is RxJava and RxKotlin?

It may uses two words to describe these libraries briefly:


ReactiveX official GitHub gives this description to RxJava:
Reactive Extensions for the JVM — a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
Simply speaking, RxJava provides not only a large number of amazing operators; such as filter, map, combine, etc, but also offers lot more that can be applied to data stream.


And they describe RxKotlin as below: RxKotlin is a lightweight library that adds convenient extension functions to RxJava. We could interpret this as RxKotlin is specific for Kotlin with…

Laurence Liu

Stay SharP

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