Focus on Android 11: development language

Time:2020-9-25

Focus on Android 11: development language

Author / product manager David winer

In the previous weeksof Android series, we covered contacts and identities, privacy and security Android 11 compatibility This issue willFocus on language。 We will bring you the “weeksof Android” content one after another, and explore the key technology points of Android in depth. You will not miss any important content.

Modern Android development starts with excellent language support. Kotlin, Java programming language and C + + constitute the basis of Android API and daily application development tools. In this issue, we’ll delve into all the latest information on Android’s three core languages: from the kotlin collaboration to Android 11’s new Java API, to even better local development tools. The latest version contains a lot of content.

Kotlin and coprogramming

Kotlin is the core of modern Android development and guiding development library. Android developers around the world have reported to us that kotlin is highly expressive, can help you write higher quality applications, and can be easily used in the existing Java code base, so kotlin is highly appreciated. More than 70% of the top 1000 apps on the play store now use kotlin and slashdata ™ It was announced earlier this year that kotlin has been the fastest growing (percentage based) language community in the past two years. In the Android 11 beta, we decided to officially recommend using coroutines to perform asynchronous operations on Android to further embrace kotlin.

With the help of coroutines, asynchronous code can be easily written, read and understood. The coroutine library is stable and has been deeply integrated with many of the jetpack libraries you may be using, including room, livedata, and workmanager. If you are not familiar with the program, please check Android ❤️ Coroutines: how to use kotlin to manage asynchronous tasks, the latest way to learn coroutines, and a new developer’s Guide. We have also serialized a series of related contents of kotlin and coprocess before. Please go to kotlin album to learn more.

Getting started with kotlin

From kotlin first in Android jetpack to deep integration with Android studio tools, Android and kotlin have formed a close relationship. Now is undoubtedly the best time to start using kotlin. However, we also heard a lot of feedback that persuading the team to adopt kotlin was not so easy. Even though kotlin can achieve 100% interoperability with the Java programming language, team members may have concerns. Is it worth taking the time to learn a new language? How should kotlin be prioritized relative to our other product and technology priorities?

Recently, we released 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 found that its null pointer exception decreased by 33% in the same period. Consistent with feedback from Android teams around the world (from duolingo to zomato to cash APP), kotlin not only ensures productivity, but also improves application quality, creating great value for teams large and small. For the latest kotlin case sharing and data, please check out the new kotlin case study page.

For beginners, we have announced a new Android basics in kotlin course. If you’re just starting to learn programming, Android basics will teach you some 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 complete Android application with 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. In Android 11, we strive to improve our support for both languages. In the Android 11 beta, we upgraded Java library support with a number of new APIs from openjdk 9, 10, and 11. We also introduced the Java library “de sugar” in Android Studio 4.0, which makes it easy to use many of the newer Java APIs even on older Android devices. Do you want to support those devices that require lower versions java.time ‘we’ve heard a lot of voices and it’s been implemented. For all the latest information on how to use these newer APIs, check out Murat yener’s support for new Java APIs. For Android 11, we also updated the Android runtime to speed up application startup through I / O prefetching.

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

Tool chain of continuous improvement

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 the application, thus improving the installation amount and retention rate of users. We also recently started to support applications that use R8 to reduce the kotlin library and kotlin reflection. For more information, check out the latest articles by MADS ager and Morten Krogh Jespersen.

More exciting

You can view the full play list of the “weeksof Android” video content, or click read the original to go to the official website for more topics. We will continue to focus on more new areas, please pay attention, and please continue to pay attention to us, looking forward to your feedback. Thank you for your company!