Every smartphone is equipped with either the Android operating system or iOS in the case of iPhones. Out of the two, Android has a dominating market share of around 75% (approx) of smartphones running on it, as of February 2019.
While Java has been and continues to be the primary language for android mobile development for a long time, Googles’ official push towards a reasonably new development language.
Though Java has been reigning since last 23 years in the world of programming language, Android Mobile Development has got its new language as Google announced the advent of Kotlin.
Benefits of using Kotlin as your next Android App development Language
Enter – Kotlin and Google
Google recently announced that it would be officially providing support for Kotlin over Java. Chet Haase, the chief advocate for Android with Google, said – “Android programming is increasingly going to be Kotlin first. Though we do understand that not everybody is on Kotlin right now. But we believe that you should start adopting the language for coding Android-based applications,”
Chet Haase further added. “That it’s totally fine for you to be still using the C++ and Java programming languages. These languages are not going away.” However, to properly understand what this means, the statements offered by Google’s tech lead for Android Studio Jeffrey van Gogh put things into perspective – “Take a look at some of the other efforts, like online training samples. In these, we’ll first do Kotlin, and then the Java programming language will be ‘best effort’. Then, of course, there are some features, like the multi-platform projects and [the UI toolkit] Jetpack Compose, that are available in Kotlin.”
The statements by both these tech heavyweights give clear-cut indications that Google is going to prefer Kotlin over Oracle-owned Java, most likely due to the decades-old legal stalemate between the two tech conglomerates.
An Introduction to Kotlin
An Android-compatible language that is concise, expressive, and designed to be type-and null-safe, Kotlin is a statically typed programming language operable on the Java Virtual Machine.
Kotlin works with the Java language seamlessly, making it easier for ‘Java-based’ developers to simultaneously code in Java and also incrementally add Kotlin code and leverage the Kotlin libraries. Something like the best of both worlds.
An advantage of Kotlin is that it combines both object-oriented and functional programming features, along with the usual benefits of being an open source, general purpose and pragmatic computer programming language. Also, many Android developers have found developing apps with Kotlin to be more efficient and enjoyable. Naturally, the extensive support from Google for these Kotlin users!
Why does Google want to shift from Java to Kotlin?
Tech experts would affirm to this in their sleep – The ecosystem for Android application development is highly fragmented. Tens of thousands of Android smartphones from different brands work-around modified versions of the Operating Systems. The differential versions of hardware configurations make things worse! On top of it, there are ever-new design trends such as the notch, folded-displays or punch-hole. All this makes for an incredibly complex and confusing environment for android app development. There’s immense scope for improvement, and Kotlin might simplify the Android mobile development ecosystem for developers.
The power of Kotlin!
The immense relevance of Kotlin is for two main reasons. Firstly, it was developed in response to the problems faced by Android developers over a period of time. Thus, it represents a solution to most of the significant issues that plague the developers coding with Java. Naturally, it, therefore, provides developers with safety, interoperability, clarity, and tooling support.
Secondly, and this is also the reason why it’s touted as a tour-de-force in the Android app development ecosystem – A major tech giant and the parent company of Android, Google, is providing first-class support for the language on its Android platform.
Google’s written announcement over the blog sheds considerable light on this – “Many new Jetpack APIs and features will be offered first in Kotlin. You should write your code in Kotlin, and especially if you’re starting a new project. As you’ll find that code written in Kotlin often mean much less code for you. Which means, less code to type, test, and maintain.”
However, the actual reason for this adoption of Kotlin could lie in its modernity, i.e. the power, flexibility and a democratic approach. It is also interoperable with the existing Android languages, and the language can take ideas from the community! Lastly, it’s built out of the need to find answers that the developers failed to obtain from Java. Also, the fact that it’s an open source language and also that Oracle is making Java a paid-one! This move from Java could sound the death-knell from Java. But that’s a far-fetched theory. Like really. All it tells us is that Kotlin has a bright future ahead.
So What’s Next?
Many developers are moving towards Kotlin, ever since Google itself became Kotlin-oriented a couple of years ago. It was designed to be better than Java.
Kotlin could very well be a ladder through which android app development companies are going to migrate away from Java, and onto a world of possibilities in their technology purviews. An interesting analogy comes to mind – Just the way Swift ensured the death of Objective C language in the past, today, Kotlin is all set to push out Java from the Android app development ecosystem.