Celebrating 5 years of Kotlin on Android


    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 executed 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 neighborhood 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 corporations.

    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 for the reason that authentic announcement. To have fun the superb language that now powers trendy 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 successful, 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 neighborhood. The thrill locally was one of many primary causes to spend money on official assist.

    “The choice by Google so as to add assist for Kotlin, I feel we underestimate how wild of a notion that was on the time. The chances of one other firm that measurement making an analogous choice based mostly on neighborhood assist and enthusiasm may 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 a number of other AndroidX libraries. Tooling improved additional, too, with Kotlin-specific reside templates, lint checks, and optimizations in R8 and ART. The reference documentation for Android was additionally revealed 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’ve an inside joke about it: ‘Advertising a programming language is simple. All you need 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’ve got a really, very, superb cause not to do 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 trendy 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 intensive use of superior language options like coroutines, top-level capabilities, 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 study Android, we’re already recommending the Android Fundamentals with Compose course.” (Florina Muntenescu, Jetpack Compose developer relations lead)

    Kotlin past Android

    Though Kotlin is a good match for Android, it’s a general-purpose language and never solely to be used on Android. For groups inside Google, Kotlin is now typically out there to make use of for each Android and server-side initiatives. 1000’s of Google engineers are writing Kotlin code, and our inner codebase accommodates greater than 8.5 million strains of Kotlin code thus far. This quantity has been growing quickly as effectively, doubling yr over yr.

    “We’ve been working to convey 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 so much about encouraging builders to make use of Kotlin for Android app growth, and we strongly encourage utilizing Kotlin for server-side growth as effectively.” (Kevin Bierhoff, lead of the Kotlin at Google crew, which helps Google engineers writing Kotlin code)

    gRPC Kotlin and Kotlin for protocol buffers are examples of Kotlin initiatives Google makes use of each in Android apps and on servers which have been open sourced and at the moment are receiving neighborhood adoption and contributions. Kotlin can also be supported on Google Cloud.

    Collaboration with JetBrains

    There’s shut collaboration between JetBrains and Google across the growth of Kotlin. The Kotlin Basis was co-founded by the 2 corporations, and it ensures that the language and ecosystem age effectively.

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

    “My crew helps JetBrains with rewriting the Kotlin compiler proper now, and we additionally work on Kotlin Image Processing, which is the primary compiler-related Kotlin challenge that’s been utterly executed 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 crew at Google)

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

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

    Be taught extra and share your individual tales

    You possibly can 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 admire these type phrases about Kotlin’s accomplishments to conclude our story.

    “Expertise can actually change individuals’s lives and it may actually make individuals happier at work. We usually give attention to ‘there’s null security’ or ‘there’s sort inference’ or all these different technical components. However once you take a step again, there’s a complete 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 crew is ready to do what they’re capable of do and that the neighborhood 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.


    Please enter your comment!
    Please enter your name here