Google announced that the next most important thing is “Kotlin first”. More and more Android developers are also turning from Java to Kotlin. Many new Jetpack APIs and new features will be used first on Kotlin. At the same time, Google also opened up Jetpack Compose in response to the “Kotlin first” strategy at the I/O conference.
For developers of Android development or Android developers, whether to choose Java or Kotlin has become a very troublesome issue. Recently, Google Android Studio technology leader Jeffrey Van Gogh responded to these questions.
Jeffrey Van Gogh said that Android will continue to support Java in many ways. Of course, he also gave a support table of Java and Kotlin. It is obvious that Kotlin has many support options compared to Java, such as AndroidX Kotlin-specific APIs, multi-platform projects, Jetpack Compose, etc., while online training and The example Google is doing its best.
Jetpack Compose is an unbundled UI toolkit that combines the responsive programming model with the simplicity and ease of use of the Kotlin programming language to simplify UI development.
Of course, although support for Java has decreased, Jeffrey Van Gogh said, “Don’t misunderstand ‘Kotlin-first’ as having to rewrite existing Java-developed Android using Kotlin” because even Google’s own application Did not do this, Java and Kotlin have a very high interoperability, the two can co-exist in a project, the current code on the Android Studio platform is probably hundreds of thousands of lines, but only 10% is written with Kotlin. Google is using Kotlin to write new features. “Kotlin has great interoperability with Java. You can write a single class in Kotlin, the rest is written in Java, or you can write 99% of the code using Kotlin, and the rest. Just write in Java.”
Jeffrey Van Gogh said that Kotlin is still immature, software build time is longer than Java, Kotlin compiler is slower than Java compiler, and Koplin generates Apk larger than Java, for Kotlin sense. Interested teams can consider writing new projects with Kotlin, but there is no need to rewrite old projects with Kotlin.