
For example, there is no more wrapping a statement in a null check: Because of that, I found myself writing code that seemed to be the same length as Java code, and then later slimming it down to take advantage of Kotlin’s strengths. Kotlin is a very concise language, allowing you to achieve the same result with less code, especially boilerplate code.

The most time consuming part of working with Kotlin is getting used to the things that will save you time.

I say could because as we’ll see, there is more than one way to write something in Kotlin. This is a really helpful tool to see how something could be done in Kotlin. While trudging through a situation like the RecyclerView/custom adapter, sometimes I just bit the bullet and wrote everything in Java, then used the “Convert Java File to Kotlin File” functionality in Android Studio (under the Code menu).

Convert Java File to Kotlin File = Life Saver. One example I can think of where this happened for me was in hooking up a RecyclerView to a custom adapter and item click listener. This can be pretty frustrating when you just want to create something that you have done hundreds of times in Java, but can’t figure out how it works in Kotlin, and the few examples you come across online don’t quite apply to your situation. The Kotlin official documentation is amazing, and there’s a great Kotlin/Android introduction on that recently came out, but there is not much out there for specific questions you may have about working with Kotlin in Android.
