Mobile

Celebrating 5 years of Kotlin on Android

Celebrating 5 years of Kotlin on Android
Written by admin


Posted by Márton Braun, Developer Relations Engineer

5 years in the past, on the 2017 Google I/O Keynote, we did one thing we had by no means carried out earlier than: we introduced official assist for a brand new programming language to construct Android apps with: Kotlin. It was nice to see how excited the Android developer group was about this announcement.

Since then, JetBrains and Google have been collaborating across the growth of Kotlin, and the Kotlin Basis was co-founded by the 2 firms.

As highlighted in these preliminary I/O bulletins, Kotlin is interoperable, mature, production-ready, and open supply. It additionally has excellent IDE assist, as JetBrains develops each the language and its tooling.

Now, 5 years have handed because the authentic announcement. To rejoice the wonderful language that now powers fashionable Android app growth, we’re taking a fast take a look at the journey of Kotlin on Android. This put up consists of quotes from a handful of people that have been concerned in making Kotlin on Android a hit, who’re becoming a member of us for this celebration.

Early years

The Kotlin adoption story began earlier than official assist from Google, throughout the Android developer group. The joy locally was one of many foremost causes to put money into official assist.

“The choice by Google so as to add assist for Kotlin, I believe we underestimate how wild of a notion that was on the time. The chances of one other firm that measurement making the same choice based mostly on group assist and enthusiasm could be very low.“ (Christina Lee, Android engineer at Pinterest, Kotlin and Android GDE)

After the 2017 announcement, Android Studio began delivery with built-in assist for Kotlin. A lot of documentation and samples have been up to date to make use of Kotlin.

In 2018, we launched the Android KTX libraries, which offer Kotlin-friendly extensions wrapping the APIs of the Android framework and several other AndroidX libraries. Tooling improved additional, too, with Kotlin-specific stay templates, lint checks, and optimizations in R8 and ART. The reference documentation for Android was additionally printed in Kotlin for the primary time.

Going Kotlin-first

At Google I/O 2019, we dedicated to Kotlin-first Android growth, additional growing our investments within the language.

“For those who take a look at a Kotlin new customers graph, you instantly discover the 2 most vital spikes – one in Might 2017 and one other in Might 2019. We now have an inside joke about it: ‘Advertising a programming language is straightforward. All it’s a must to do is make the biggest working system on the planet name it an official language in the course of the annual keynote’” (Egor Tolstoy, Kotlin Product Lead at JetBrains)

Being Kotlin-first implies that we now design our documentation, samples, coaching content material, new libraries and instruments for the Kotlin language first, whereas nonetheless supporting customers of the Java programming language.

”Now after we wish to begin a Jetpack Library, we’re writing it in Kotlin except we have now a really, very, superb purpose not to try this. It’s clear that Kotlin is the first-class language.” (Yigit Boyar, early proponent of Kotlin inside Google, presently main the event of a handful of Jetpack libraries)

Some examples of Kotlin-first Jetpack libraries are Paging 3 and DataStore, that are each powered by coroutines and Flows for asynchronous operations.

Jetpack Compose, Android’s fashionable UI toolkit is our biggest dedication to Kotlin thus far, because it’s Kotlin-only. It’s powered by a Kotlin compiler plugin, and it makes in depth use of superior language options like coroutines, top-level features, and trailing lambdas.

“Kotlin is right here to remain and Compose is our guess for the long run. Proper now, for builders which can be beginning to be taught Android, we’re already recommending the Android Fundamentals with Compose course.” (Florina Muntenescu, Jetpack Compose developer relations lead)


Kotlin past Android

Regardless that Kotlin is a superb match for Android, it’s a general-purpose language and never solely to be used on Android. For groups inside Google, Kotlin is now usually accessible to make use of for each Android and server-side tasks. Hundreds of Google engineers are writing Kotlin code, and our inner codebase incorporates greater than 8.5 million strains of Kotlin code thus far. This quantity has been growing quickly as nicely, doubling 12 months over 12 months.

“We’ve been working to deliver Kotlin to Google engineers for the previous couple of years by including Kotlin assist to all of the instruments they use. This consists of the construct system, static evaluation instruments, libraries and APIs. We’ve talked loads about encouraging builders to make use of Kotlin for Android app growth, and we strongly encourage utilizing Kotlin for server-side growth as nicely.” (Kevin Bierhoff, lead of the Kotlin at Google workforce, which helps Google engineers writing Kotlin code)

gRPC Kotlin and Kotlin for protocol buffers are examples of Kotlin tasks Google makes use of each in Android apps and on servers which were open sourced and are actually receiving group adoption and contributions. Kotlin can also be supported on Google Cloud.

Collaboration with JetBrains

There may be shut collaboration between JetBrains and Google across the growth of Kotlin. The Kotlin Basis was co-founded by the 2 firms, and it ensures that the language and ecosystem age nicely.

Google engineers have additionally been engaged on enhancing the compiler and on creating essential tooling for the language.

“My workforce helps JetBrains with rewriting the Kotlin compiler proper now, and we additionally work on Kotlin Image Processing, which is the primary compiler-related Kotlin venture that’s been fully carried out at Google. We work extra intently with JetBrains than another components of Google.” (Jeffrey van Gogh, member of the Kotlin Basis, lead of the Kotlin engineering workforce at Google)

JetBrains and Google additionally coordinate new releases of the language and the accompanying tooling in order that builders are in a position to make use of the newest releases as easily as doable.

“The collaboration will get stronger over time, and I’m actually excited to see its impression on Kotlin’s future. Our coordinated pre-release checks are getting higher and higher.” (Liliia Abdulina, Kotlin QA workforce lead at JetBrains)


Be taught extra and share your individual tales

You’ll be able to learn extra tales about Kotlin from our interviewees in the accompanying Medium put up. We’d additionally love to listen to your tales of studying and adopting Kotlin for Android growth! Share them on social media utilizing the hashtag #Hi5KotlinOnAndroid!

Lastly, let’s recognize these sort phrases about Kotlin’s accomplishments to conclude our story.

“Know-how can actually change individuals’s lives and it will probably actually make individuals happier at work. We usually deal with ‘there’s null security’ or ‘there’s kind inference’ or all these different technical components. However if you take a step again, there’s an entire story in there about the entire individuals who had their ardour for coding ignited or reignited as a result of Kotlin is such a beautiful language. It is simply so spectacular that the workforce is ready to do what they’re capable of do and that the group is nearly as good as it’s.” (Christina Lee, Android engineer at Pinterest, GDE for Android and Kotlin)

Have a pleasant Kotlin on Android!

*Java is a trademark or registered trademark of Oracle and/or its associates.

About the author

admin

Leave a Comment