Image for post
Image for post

This is how we turn a 5 minutes build down to 15 seconds

Long story short

Just like every other Android project, we start with a single :app module. At the time we didn’t have many features, the codebase was small and compact, everything was good. Time goes by, we have more features in the project, our leader realizes this will soon become a problem so he split the project into multiple modules. Parallel builds were great, we were very happy with the result. Time goes by again, business grows, more and more features have been added to the project at the point we have 60+ modules in the project. When making changes on a single…

Image for post
Image for post

At this time you all probably heard about the new API to get the result from an Activity. In a nutshell, they look something like this:

val getContent = registerForActivityResult(GetContent()) {
// Handle the returned Uri

override fun onCreate(savedInstanceState: Bundle?) {
// ...
selectButton.setOnClickListener {

They change from hooking into onActivityResult to a more elegant callback style. And as always, it comes with some gotcha as mentioned here.

If you use the Navigation Component and want to get a result from another Fragment, then good luck, because you have to do some crazy stuff like:


Featuring AndroidX, lazy initialization and more

Image for post
Image for post
Photo by Thought Catalog

WorkManager has come a long way, there are a lot of changes and improvements in the library but the Dagger setup remains unchanged and still working well. Despise all of that, I feel like my article 2 years ago is a bit out of date. So here you are, the 2020 edition with the latest stuff and best practices updated.

In a nutshell, there are 2 ways you can perform dependence injection to a Worker class.

Image for post
Image for post
Photo by Benjamin Suter on Unsplash

The problem

Build time has always been a big issue for Android developers. In order to reduce build time, developers usually split the project into multiple modules to take advantage of the Gradle’s parallel execution feature. At Tiki, we modularize our project with the “per feature” approach, which means each feature will sit in its own module.

Image for post
Image for post


Android paging library helps you load and display small chunks of data at a time. In real work use cases, we might have multiple item view types, additional headers or separators between items.

Image for post
Image for post
Photo by Marvin Meyer on Unsplash

Table of content:
— TL; DR
— Introduction
— Goal
— Problems
— Solution
— Step by step implementation
— Understand the generated code
— Summary
— Source code
— Alternative setups
— Reference


We cannot perform constructor injection in Worker class because of the params and appContext is only available at runtime, so we perform the constructor injection with its Factory instead. Then set up a multi binds map with those factories, inject this map of Factory inside a custom WorkerFactory then create new Worker instance from there. Fully working sample project can be found here


Edit 6 March…

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