Tag: kotlin

Let's Get The Job Done!

Do you code DRY!

What is DRY principle, and how to achieve that in your android development journey, let’s discuss. DRY stands for “don’t repeat yourself!“. it simply means that you have to never write any piece of code twice otherwise you are really doing it wrong. because when a logic related to that piece of code changes we…
Read more

Kotlin Object Keyword

In this post we are gonna find out what is the Object keyword in Kotlin and discuss it’s use-cases. in one definition the Object is another way to declare classes but with some differences, the most important difference is that defining an object makes it act like a singleton object, also by defining an object…
Read more

How to Unit Test live Data?

In this article we are going to discuss how we could unit test the Live Data object from googles architectural components. If you have tried to test live Data Object on Android platform you have certainly encountered the error below. java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details. at android.os.Looper.getMainLooper(Looper.java) at android.arch.core.executor.DefaultTaskExecutor.isMainThread(DefaultTaskExecutor.java:58)…
Read more

Kotlin : some cool features

Let’s take a look at some of kotlin‘s cool features here , gathered from multiple sources across web , i personally hope that kotlin replaces java in android totally. Extension function: As it’s name indicate this adds some extra functionality to the existing component. Have a look below we are adding an extra functionality to…
Read more