Swap ViewModel during testing in Android via Hilt

I have seen a lot of Hilt examples where we hard code the actual implementation of ViewModel in the Activity or Fragment. May be, this is what you need, and you want to test your Fragments or Activities with the actual ViewModel. But if you are like me, and you have some use case where you want to inject a fake ViewModel and test your Fragments or Activities, then this blog is for you.

Generics in Kotlin

What is it?

Publishing Android library to maven central

All my libraries has a script to publish the artifact to bintray and from there auto release to mavenCentral. But recently, Bintray was shutdown and hence I have to publish directly to maven central repository. This is how I did it.