DEV Community

Rakesh Patel
Rakesh Patel

Posted on • Updated on

Look No Further Than Kotlin for Android App Development

I have been sneaking for a while in the Android app development space and I must it seems as if it has done using the Java programming language. Last year, Google announced that Kotlin would forever more be supported as a first-class programming language for Android. And today it has become the most favored programming language.

Java being object-oriented and well-crafted programming language has limited implementation dependencies. In a layman’s language, it allows the developer to write once and run anywhere in terms of platforms that support Java. Whereas Kotlin is a statically-typed programming language that runs on the JVM. Compiled well to JavaScript source code and to native executables, Kotlin offers a bunch of amazing features such as:

• It is an opensource
• Full Java Interoperability
• Kotlin compiles to JVM bytecode or JS
• Data Classes 
• Defaulted parameters
• imposes no runtime overhead
• Extension functions
• Swift
• Write less code in comparison to Java

Why use Kotlin for Android?

Android has been a popular choice for global consumers for a while now, thanks to the thousands of devices it powers. Although, the usage of Java for app development seems to be widening at a fanatic pace. But it is equally important for you to know that Java comes with a lot of historical baggage.

Java 8 did solve some language issues and even more were corrected with Java 9 and 10. But are you well aware regarding the fact an Android developer needs to set the minimum SDK to Android 24 just to use Java 8, which isn’t an option? Kotlin on the other hand aims to fill that gap of a missing modern language for the Android platform.

It features few crucial tenets worth considering such as:

• Reduces the amount of boilerplate code one requires to write

• Quite expressive when it comes to making your code more readable and understandable

• The entire classes of errors such as null pointer exceptions can be avoided

• Interoperable to leverage existing frameworks and libraries of the JVM with 100 percent Java interoperability.

• Versatile for building server-side applications, Android apps or frontend code running in the browser.
Downsides of Kotlin language
The technology has indeed come as a boon but they even have a fair share of downsides as well.

• Sizeable Runtime- One of the major drawbacks of Kotlin is the file size that its standard library and runtime increase. On an average, a .apk file expands by 800 KB which isn’t much but if some file is already heavy, then it may become an issue to look into. Overall, it can make the user think before downloading heavy files.

• Complex Code Decryption- Sometimes your greatest strength can become your weakness. Even after having great syntax, you may still face certain issues because a small code is infused with so much. In the case of Java, its code is not that compact.

• Lack of official support- Android studio being officially integrated for Googles app development procedure but it fails to extend its support to Kotlin as the language is not officially endorsed by Google.

So that’s all for now! Keep watching the space for more information and updates on Android application development.

Top comments (1)