Kotlin For Android: A Boon To Developers

By

Chandra Sekar P

Technical Lead - Engineering

MOTHER OF KOTLIN

JetBrains, known for IntelliJ IDEA (Android Studio is based on IntelliJ), has introduced the Kotlin language. Kotlin is a statically-typed programming language that runs on the JVM. It can also be compiled to JavaScript source code. Kotlin has some amazingly cool features!

Kotlin is a great fit for developing Android applications, bringing all of the advantages of a modern language to the Android platform without introducing any new restrictions:

  • Compatibility: Kotlin is fully compatible with JDK 6, ensuring that Kotlin applications can run on older Android devices with no issues.
  • Performance: A Kotlin application runs as fast as an equivalent Java one, thanks to very similar bytecode structure.
  • Interoperability: Kotlin is 100% interoperable with Java, allowing to use all existing Android libraries in a Kotlin application.
  • Footprint: Kotlin has a very compact runtime library, which can be further reduced through the use of ProGuard.
  • Compilation Time: Kotlin supports efficient incremental compilation, so while there’s some additional overhead for clean builds, incremental builds are usually as fast as or faster than with Java.
  • Learning Curve: For a Java developer, getting started with Kotlin is very easy. The automated Java to Kotlin converter included in the Kotlin plugin helps with the first steps.

Kotlin has been successfully adopted by major companies, and a few of them have shared their experiences: Pinterest has successfully introduced Kotlin into their application, used by 150M people every month.

Basecamp’s Android app is 100% Kotlin code, and they report a huge difference in programmer happiness and great improvements in work quality and speed. Keepsafe’s App Lock app has also been converted to 100% Kotlin, leading to a 30% decrease in source line count and 10% decrease in method count.

A BIG THANK YOU!

Kotlin aims at creating a language that would be in line with the same principles. It drive tools to create something that helps developers with the tedious and mundane tasks, allowing them to focus on what’s truly important. And of course make the process as enjoyable and fun as possible.

IS KOTLIN GOING TO BECOME PRIMARILY FOCUSED ON ANDROID?

The Kotlin’s goals are to be a language that is available on multiple platforms and this will always be the case. It will keep supporting and actively developing Kotlin/JVM (server-side, desktop and other types of applications), and Kotlin/JS. We are working on Kotlin/Native for other platforms such as macOS, iOS and IoT/embedded systems

When you run a Java application, the app is compiled into a set of instructions called Bytecode and runs in a virtual machine. Over the past several years, a number of new programming languages have been introduced to also run on the Java virtual machine. Whilst the resulting app looks the same for the virtual machine, the idea is the language features can help developers write simpler code and fix some of Javas issues.

WHY KOTLIN FOR ANDROID?

Kotlin aims to fill that gap of a missing modern language for the Android platform. There are a few core tenets that Kotlin lives by; it strives to be:

  • Concise to reduce the amount of boilerplate code you need to write
  • Expressive to make your code more readable and understandable.
  • Safe to avoid entire classes of errors such as null pointer exceptions.
  • Versatile for building server-side applications, Android apps or frontend code running in the browser.
  • Interoperable to leverage existing frameworks and libraries of the JVM with 100 percent Java interoperability.

By

Chandra Sekar P

Technical Lead - Engineering

Related articles

Exploring the Evolution of UI/UX Design

User interface (UI) and user experience (UX) design are constantly evolving disciplines driven by the need to create engaging and user-friendly digital experiences. As technology

Let's talk about your next big project.

Looking for a new career?