By David Winer, Product Manager

In the #11WeeksOfAndroid series, we covered contacts and identities, privacy and security, and Android 11 compatibility. This installment focuses on language. We’ll be bringing you #11WeeksOfAndroid, an in-depth look at Android’s key technology points, and you won’t miss anything.

Modern Android Development starts with great language support. Kotlin, the Java programming language, and C++ together form the basis of the Android API and everyday application development tools. In this installment we’ll delve into all the latest news about Android’s three core languages: from Kotlin coroutines to Android 11’s new Java API to better native development tools, there’s a lot going on in the latest release.

Kotlin and coroutines

Kotlin is at the heart of modern Android development and instructional development libraries. Android developers around the world tell us that Kotlin is expressive, helps people write higher-quality apps, and can easily be used in existing Java code bases. More than 70% of the top 1,000 apps on the Play Store now use Kotlin, and SlashData™ announced earlier this year that Kotlin has been the fastest growing language community (in percentage terms) over the past two years. In the Android 11 beta, we decided to embrace Kotlin further by officially recommending the use of coroutines to perform asynchronous operations on Android.

With coroutines, asynchronous code can be written, read, and understood easily. The coroutine library is stable and already deeply integrated with many of the Jetpack libraries you might be using, including Room, LiveData, and WorkManager. If you’re not familiar with coroutines, check out Android ❤️ Coroutines: How to Use Kotlin to manage Asynchronous Tasks, the latest ways to learn coroutines, and a new guide for coroutines developers. We’ve written a series of stories about Kotlin and coroutines before, check out the Kotlin album.

The Kotlin Starter’s Guide

From Kotlin-First in Android Jetpack to deep integration with Android Studio tools, Android and Kotlin have formed a close relationship, and now is definitely the best time to start using Kotlin. However, we also heard a lot of feedback that it wasn’t that easy to convince the team to adopt Kotlin. Even though Kotlin can achieve 100% interoperability with the Java programming language, team members may have concerns. Is it worth the time to learn a new language? How should Kotlin be prioritized relative to our other product and technology priorities?

We recently published a new case study from the Google Home team to help answer some of these questions. Over the past year, the Google Home team moved all new feature development to Kotlin and saw a 33% drop in null-pointer exceptions over the same period. This is consistent with feedback from Android teams around the world — from Duolingo to Zomato to Cash apps — that Kotlin not only ensures productivity, but also improves App quality, creating tremendous value for teams large and small. For Kotlin’s latest case sharing and data, check out the new Kotlin Case Studies page.

For starters, we’ve announced a new Android Basics in Kotlin course. If you’re just learning to program, Android Basics teaches basic programming concepts, such as functions and variables, and will take you into the programming World, from the entry-level “Hello World” to building a full Android application using Kotlin.

Java programming language and C++

When we announced official support for Kotlin three years ago, we didn’t forget the many Java and C++ Android developers. With Android 11, we’re looking to continually improve support for both languages. In Android 11 Beta, we upgraded Java library support with a number of new apis from OpenJDK 9, 10, and 11. We also launched the Java library “Desugar” in Android Studio 4.0, which makes it easy to use many of the newer Java apis even on lower versions of Android devices. To those developers who have asked for java.time support on older devices, we have heard the outcry and implemented it. For all the latest information on how to use these newer APIs, check out Murat Yener’s talk on Support for Newer Java APIs. For Android 11, we also updated The Android Runtime to speed up app startup with I/O prefetch.

The C++ developer experience is also improving. Android 11 includes updates to the native toolchain, including better profile oriented optimization (PGO) tools and improvements to native dependency management in Android Studio 4.0.

Constantly improving tool chain

Finally, we will continue to improve the D8 and R8 compilers in Android Studio. Android Studio has built-in support for the R8 compressor, which can help you reduce the memory footprint of your application, thereby increasing user installs and retention. We also recently started supporting applications that use R8 to shrink the Kotlin library and use Kotlin reflection. For more information, check out the latest article by Mads Ager and Morten Krogh-Jespersen.

More wonderful

You can check out the full playlist of #11WeeksOfAndroid video content, or go to the official website to learn more about the topic. We will continue to focus on more new areas, please pay attention, also please continue to pay attention to us, looking forward to your feedback. Thank you for being with us.