Kotlin is the official language of Android

At this year's Google I / O in California, Google made a number of announcements that should be particularly exciting for Android developers. Among other things, they want to rely on Kotlin as the preferred programming language for Android in the future.

Now Kotlin is ousting Java from the throne

At Google I / O 2017, the tech group announced that it wanted to support Kotlin as the official programming language for Android. This was followed by integration into the company's own IDE (development environment) with Android Studio 3.0 and the language coexisted for a while alongside Java - the previous main language - in the Android cosmos.

Official support from Kotlin for Android was obvious at the time. The language developed by JetBrains can be compiled in the JVM (Java Virtual Machine) just like Java, but offers a lot more convenience, especially for developers. In addition, the great popularity of the language also indicates this. According to Google, over half of professional Android developers now use Kotlin.

The Czech software company JetBrains is responsible, among other things, for the Java IDE IntelliJ. Many developers use this in addition to Android Studio in Android development.

Now Google is announcing that the typed language will no longer just exist alongside Java, but that Kotlin will be the preferred programming language for Android in the future. Developers are even advised to use the language for future projects. They also want to work with JetBrains and the Kotlin Foundation, founded in 2018, to improve the tools and documentation for programming with Kotlin. In addition, under the title "Kotlin / Everywhere“Training courses on dealing with the language are offered.

What makes Kotlin so special?

Many developers should already be familiar with Kotlin, as the language is already enjoying great popularity. It was only released in a stable version in 2016. For those who do not yet know the language, we give a brief overview:

In addition to Android development, Kotlin is also suitable for the web and can be translated into JavaScript. The interoperability with Java is particularly practical. Kotlin was developed under the requirement to be compatible with Java. Therefore, code from both languages ​​can be used in projects. This makes Kotlin for Android particularly suitable and certainly facilitates the transition in many projects. In this way, Kotlin code can easily be called in existing Java code. Furthermore, developers in new projects that are created directly in Kotlin do not have to do without their Java libraries and can simply import them.

A modern syntax that makes life easier

The real advantage of the language, however, lies in its modern and simple syntax. After all, with Kotlin you can avoid a lot of boilerplate code that was inevitable in Java. The language also offers some practical functions that drastically reduce the error-proneness of the code. For example, developers must explicitly declare whether variables have the value "zero“, Otherwise compiler errors will occur. Many developers will breathe a sigh of relief at the thought of stopping to learn more about Java'sNullPointerExceptions“Having to annoy at runtime. Presumably, it is these more modern aspects of the language that lead Google to use Kotlin as their preferred programming language for Android.

For more information on Kotlin, you should definitely take a look at the very extensive documentation on the language from JetBrain. Google also offers comprehensive documentation on the language on its website. You can also find various tutorials on using Kotlin for Android here.

The book "Android with Kotlin - Kurz & Gut" helps you get started with the programming language (provision link)

Teaser image by Kotlin

Code screenshots created with Carbon

Moritz Stoll

can do a lot, but nothing really. Likes to deal with tech and trara a lot, is an integral part of the Netzpiloten editorial team and moderates the Netzpiloten podcast Tech and Trara. For him, the (digital) world is a place full of possibilities and exciting technologies that you can try out, work on and question.

Send articles by email
Tags: Android, Android development, google, Google I / O, java, JVM, Kotlin, software development