Kotlin

Kotlin is a functional language created by Jetbrains that can be used to boost Android development. Lambas, null safety, extension functions and a lot of breaking features make Android development simpler and easier. Start learning today!
Get the book!Don't miss new posts

How to use Kotlin code from Java: start using Kotlin today (KAD 29)

One of the great wonders of Kotlin is that it's fully integrated with Java. This means that although all your application code is written Java, you can create a class in Kotlin and use it from Java without any issues. This potentially gives you two advantages: You can...

Sealed classes in Kotlin: enums with super-powers (KAD 28)

Sealed classes in Kotlin are another new concept we didn't have in Java, and open another new world of possibilities. A sealed class allows you to represent constrained hierarchies in which an object can only be of one of the given types. That is, we have a class with...

Objects in Kotlin: Create safe singletons in one line of code (KAD 27)

Kotlin objects are another element of the language that we Android developers are not familiarized with, because there is nothing like that in Java. In fact, an object is just a data type with a single implementation. So if we want to find something similar in Java,...

Interfaces in Kotlin. Who said interfaces can’t have code? (KAD 26)

The interfaces in Kotlin will allow you to reuse more code than what you can get with Java. The reason is very simple: you can add code to your interfaces. If you've tried Java 8, it's something pretty similar. The good thing about being able to include code in an...

What do 17 Google Developers Experts for Android think about Kotlin?

Google has already expressed several times that they don't have anything against Kotlin, and that they're not preventing us from using it while the compiler still generates valid bytecode. But many people is still waiting for an official support, something that could...

Dialogs and alerts on Android using Anko and Kotlin (KAD 24)

Creating alerts and dialogs on Android is a relatively simple task thanks to the builder, but due to the verbosity of the language it usually becomes something quite illegible. In Kotlin, by the mere fact of the lambdas, it simplifies us a little to understand what is...

How to mock final classes on Kotlin using Mockito 2 (KAD 23)

One of the most common issues for Kotlin, as we talked about in a previous article, is that all classes and functions are closed by default. This means that if you want to mock a class (something that may be quite common in Java testing), you need to either open it...

Unit tests on Android with Kotlin (KAD 22)

Of course, Kotlin also allows us to do unit tests in a very simple way, and very similar to what we're used in Java. There are some small complications when we use libraries like Mockito, but we'll see some tricks to make it easier. Unit tests in Kotlin Although the...

Kotlin for Android Developers

Kotlin for Android Developers

Start learning Kotlin today with this book by creating an Android App from ground up.

Get it Now!