Sign in

Passionate Android developer and curious tinkerer!🤖 Knowledge is power🦸! Share freely!📚

Recently I decided to host my personal portfolio site using GitHub pages. Even though they have very detailed instruction on how to setup a custom domain, I found it cumbersome to get to the right information. 🙄

Here are 2 key steps to setup your GitHub pages enabled project to use your custom domain.

⚙️Step 1 — Set domain in GitHub project

Go to your GitHub Pages site’s repository settings. Under “Custom domain”, add or remove your custom domain and click “Save”.

Setting “custom domain” creates a file named CNAME in the same repository. Don’t delete it.

⚙️Step 2 — Set custom resource record for domain

This step is specific to your domain name register (like GoDaddy,, Google Domains, etc). All you need to do is set A & CNAME records for the selected domain.

This list of open-source Android apps may come in handy if you have grasped all necessary concepts to develop Android application and you think you are ready to work on an application that follows industry standards. By industry standards, I mean, an app that has good architecture, is scalable and maintainable in the long run.

Here is the list of open-source apps in this article:

  • Android Architecture Blueprints v2Google’s official recommended app
  • Plaid 2.0 Google’s official recommended app with focus on Material Design
  • SunflowerGoogle’s official recommended app with more focus on many Jetpack components
  • CatchUp

I am trying to learn Kotlin coroutines, and was trying to learn more about how to handle errors from suspended functions. One of the recommended way by Google is to create a “Result” class like the following:

sealed class Result<out R> {
data class Success<out T>(val data: T) : Result<T>()
data class Error(val exception: Exception) : Result<Nothing>()

This allows us to take advantage of Kotlin’s when like following:

when (result) {
is Result.Success<LoginResponse> -> // Happy path
else -> // Show error in UI

However, I have recently stumbled into Kotlin’s runCathing {} API that makes use of…

Preview of editing animated vector drawable (AVD).

Android’s ProgressBar widget comes with lot of customization controls and flexibility to set custom animated drawable. However, setting AnimatedVectorDrawable is not one of the option.

So, this is a quick trick on how to use custom ImageView to create indeterminate progress indicator using Animated Vector Drawable (AVD).

class AvdLoadingProgressBar @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : AppCompatImageView(context, attrs, defStyleAttr) {
private val avd = AnimatedVectorDrawableCompat.create(context, R.drawable.avd_anim)!!

init {
avd.registerAnimationCallback(object : Animatable2Compat.AnimationCallback() {
override fun onAnimationEnd(drawable: Drawable?) {
post { avd.start() }
Here is more verbose Gist version…

Android and it’s community has evolved a lot over past decade. Now a days we can find open-source libraries to do almost anything — Zoomable ImageView, CameraX, RecyclerView Sticky Header, Tooltip, and many more.

Photo by Shahadat Rahman on Unsplash

Syntax highlighting is one of them and there are few libraries for that too. If this is a solved problem, then why am I writing about another solution then?

Well, some of the libraries I have explored are outdated, and some of them might not be as feature rich. …

My personal visualization of Dark-Mode for

I have love and hate relationship with Medium with a much higher percentage towards love 🥰. I have been craving for 🌗 dark/night-mode support for the web site for a long time. Thankfully they already support dark-mode on the Android & iOS app 😍.

This is a quick guide on how you can easily set up Github Actions CI workflow to automatically post APK to Firebase App Distribution on merge to release or master (or soon to be known as main) branch.

Firebase already has an excellent guide 🏆 on how to set up the Gradle task on your Android project to post APK to App Distribution. However, I will quickly touch those areas using the easiest path ✌️.

PREREQUISITE: You already have Firebase project setup for the app with google-services.json file in your Android app project.

Setup Gradle for the App

On your root build.gradle

A snapshot of the ‘H.K. Vision’ Muzei Plugin on Android Device — Available as BETA release on Google Play

I have a hobby of taking a lot of pictures, and some of the pictures do turn out nice (at least to me 😊). So, I’ve also created a web portal to showcase those pictures 🖼️.

As an Android engineer, I was aware of Muzei Live Wallpaper app created by Roman Nurik back in 2014. Recently I’ve seen some updates from Ian Lake who took over the project while ago, so I decided to make a plugin for Muzei to use my pictures as wallpaper on my Android phone.

ps. If you simply want to use the plugin, see README

GitHub Actions Continuous Integration (CI) Workflow

On April 14th, 2020 GitHub announced a major change in their plans to allow free private repositories. It’s a good time to make use of their free CI/CD known as “Actions”. Private repositories have 2000mins/month and public repositories have unlimited minutes (see pricing).

This is a quick write-up on how you can leverage Actions CI Workflow to do any task using supported node.js modules from npm.

NOTE: If you are new to GitHub Actions, I highly recommend reading their ‘Getting Started’ guide first.

The concept is simple, you setup node environment on CI machine, install required CLI-based node modules, and…

Recently I have had to create UI that required user tappable/clickable text in the same text view. I know this is kind of unusual as the touch target for the view will likely be smaller compared to a button with no outline style. However, I wanted to share a quick Kotlin extension function that is dynamic and well tested.

Android TextView where “Register Now” is a tappable link with a callback.

Here is an example usage for generating clickable link within the same TextView

So, if your project requires something like this take a look at the following extension function for android.widget.TextView.

You should be able to easily convert this to Java if needed. Let me know if you find this useful. Cheers ✌️

Hossain Khan

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