Google announced support for Kotlin in Android at Google I/O 2017, but many of us aren’t sure what’s going on or why we should care.
Let’s take a look at the important things you need to know about Kotlin if you’re not an Android developer.
What is Kotlin?
Kotlin is a programming and development language from JetBrains. They’re the folks behind the IntelliJ Java IDE and Kotlin is really, really interoperable with Java. That means developers can use the Java Libraries they already use now, and the code they write with Kotlin can also be converted to Java and vice versa.
This is important because Java is one of the most-used programming languages in the world, and has been used for Android since the beginning. Throwing away that much work is silly.
What is the future of Kotlin?
JetBrains’ thoughtful work on Kotlin’s design is one of the reasons we’re embracing the language. Google is partnering with JetBrains to ensure a wonderful overall developer story—from language, to framework, to tools. And, we are excited to be working together to move the Kotlin language into a non profit foundation.
Which versions of Android does Kotlin support?
All of them! Kotlin is compatible with JDK 6, so apps with Kotlin safely run on older Android versions.
Does using Kotlin have any performance impact?
Kotlin doesn’t have a direct performance impact, but just as with the Java language, you should be thoughtful about how you use it. For example, repeated copying between new collection instances can impact GC performance, and calling a method that accepts non-null types adds a method call for the null check (though you can disable runtime null checks in the compiler with -Xno-param-assertions
).
Why are developers excited about Kotlin support?
Kotlin is fully supported in JetBrains’ IntelliJ editing environment. A programming tool of any kind is only as good as its support. JetBrains provides simple but powerful Java to Kotlin converters and can generate Java and JavaScript from Kotlin code.
How do I add Kotlin to my existing projects?
Select your module in the Project window, and then select File > New, select any Android template, and then choose Kotlin as the Source language. For more information, see Get Started with Kotlin.
Can I use Kotlin with C++?
Yes, JNI is fully supported with Kotlin. Simply mark the JNI method with the external modifier.
Is Kotlin open source?
The preferred license for Kotlin is the Apache Software License, Version 2.0 (“Apache 2.0”), and the majority of the Kotlin software is licensed under Apache 2.0. While the project will strive to adhere to the preferred license, there may be exceptions that will be handled on a case-by-case basis. For example, certain third-party dependencies used by Kotlin may be licensed under different open source licenses which are still compatible with the Apache 2 license.
Where can I learn more about Kotlin or get started using it?
Visit JetBrains’ Kotlin website for everything you need to get started.
You can use Android Studio, Eclipse, IntelliJ IDEA or a standalone compiler to build Kotlin apps for Android or your web browser. There are even great tutorials to get you pointed in the right direction!
It’s not difficult, and it’s fun. Don’t be afraid to try and learn as much as you can!
Kotlin for android developers pdf
Android kotlin tutorial for beginners developers
A series of complete step-by-step tutorials to walk you through how to accomplish different tasks in Kotlin, from Getting Started to writing Android applications and more. If you have a tutorial you’d like featured here,