Code

Comparing Java and Kotlin for Android App Development

Comparing Java and Kotlin for Android App Development

Learn: Java Developer Profession

Learn More

In 2019, Google announced Kotlin as the primary programming language for Android development, while leaving Java as an alternative. This decision created some confusion among aspiring developers. While Java is attractive for its versatility and extensive ecosystem, Kotlin offers a more modern and readable syntax, making it attractive for new projects. Developers face a choice between time-tested Java and the innovative capabilities of Kotlin, highlighting the relevance of both technologies in mobile development.

We explore why this is important and in what order to master the material.

New applications are written in Java and Kotlin

The second half of 2020 saw interesting changes in programming language rankings. The popularity of programming languages ​​continued to fluctuate, while developers sought effective tools to complete their tasks. Languages ​​such as Python and JavaScript maintained their positions due to their widespread use in web development, machine learning, and automation. Java, despite the competition, remained in demand in enterprise applications. Languages ​​such as C# and PHP also had their audience, especially among developers working in specific fields. Analyzing these rankings helps understand current programming trends and choose the most promising languages ​​to learn and use in projects.

  • TIOBE: Java is 2nd place, Kotlin is 33rd place. Calculated based on search queries on Google, YouTube, Bing, and other popular sites.
  • RedMonk: Java is 3rd place, Kotlin is 19th place. Calculated based on the frequency of mentions of programming languages ​​on Stack Overflow and GitHub.
  • PYPL: Java is 2nd place, Kotlin is 12th place. Calculated based on search queries for technical documentation of programming languages ​​on Google.
  • IEEE Spectrum: Java is 2nd place, Kotlin is 18th place. Calculated by frequency of mentions on Google, Twitter, GitHub, Reddit, and other platforms.
  • Stack Overflow: Java is 5th, Kotlin is 13th. Calculated based on the results of the Stack Overflow Survey.

Java consistently ranks among the top programming languages, remaining in the top five most popular among developers. At the same time, Kotlin is not in the top ten, indicating that the majority of mobile applications are still developed in Java. Despite growing interest in Kotlin, Java remains the primary choice for creating mobile solutions. Developers value Java for its reliability and broad ecosystem, making the language preferred for many projects.

Java is one of the most used programming languages ​​in the world. Source

Statistics of rapidly growing programming languages ​​according to Octoverse GitHub and Stack Overflow shows that Kotlin ranks fourth. This demonstrates that Kotlin's growing popularity hasn't diminished the demand for Java. Android currently supports both languages, meaning new apps continue to be developed using both Kotlin and Java. Thus, developers have the opportunity to choose between two languages, which promotes diversity and flexibility in creating mobile applications.

Kotlin is one of the fastest growing programming languages. Source

Java and Kotlin are needed to support written applications

Let's visit developer.android.com, the official website of the Android platform, where developers share their opinions on the advantages of the Kotlin programming language. Kotlin has established itself as a modern and convenient language for creating Android applications, offering numerous features for improving productivity and simplifying development. Developers note that Kotlin not only improves code readability but also helps avoid common errors thanks to its conciseness and expressiveness. Additionally, Kotlin integrates seamlessly with existing Java projects, making it an ideal choice for developers looking to update their applications.

  • Code is shorter and takes up less space,
  • Compactness speeds up work and simplifies maintenance,
  • Regular maintenance reduces crashes,
  • Reduced crashes improve security,
  • A secure application is easier to develop and fill with new features.

Reviews are supported by statistics.

  • Kotlin powers 70% of the top 1,000 Google Play apps.
  • More than 60% of professional Android developers write in Kotlin.
  • Kotlin is used by Slack, Robinhood, Evernote, Zomato, Adobe Reader, WordPress, Pinterest, Deliveroo, Twitter, Reddit, and other apps.

Reading this text, it might seem as if all Android development is focused on Kotlin. However, to understand the situation more fully, it's worth considering three key aspects. First, Kotlin has indeed become the language of choice for many developers due to its simplicity and modern features. Second, there are many projects written in Java, which remains an important language in the Android ecosystem. Third, despite Kotlin's growing popularity, development in other languages ​​and technologies, such as Flutter and React Native, continues to grow and attract attention. Thus, while Kotlin is central to Android development, it's important to consider the diversity of tools and languages ​​used in this field.

  • Kotlin was added to Android in 2017. Prior to this, 2.9 million apps had been added to Google Play, most of which were written in Java.
  • Java is Oracle's native language. A lawsuit between Oracle and Google over the unauthorized use of Java in Android has been ongoing since 2010. The case is currently on appeal, and either side could win. If Google loses, it will pay Oracle over $9 billion—an ever-growing sum calculated based on lost revenue from Java apps on Android. For this reason, the Android website does not provide data on the prevalence of Java and its scale compared to Kotlin.
  • The statistics published on developer.android.com do not cite any studies or explain who Google included in the 60% of professional Android developers or how much code has been migrated from Java to Kotlin in 70% of the top 1,000 Google Play apps.

The conflict between Google and Oracle has led to significant changes in the development ecosystem. As a result, Android is migrating to the Kotlin programming language, making it more popular among developers. At the same time, Java continues to grow its code base, which remains inaccessible to the Kotlin community. Automatically converting a large Java application to Kotlin is not possible due to language differences. The need to manually edit some of the code remains relevant, which complicates the migration process. Therefore, developers should consider these aspects when choosing a programming language for their projects.

Different programming languages ​​have their own unique approaches to null safety, operator overloading, constructors, and other aspects described in the documentation. Kotlin, for example, implements special rules for working with Java, requiring developers to be proficient in both technologies. This allows for efficient translation of Java code to Kotlin while maintaining Java compatibility. Thus, understanding these languages ​​becomes important for successful software development.

Approximate ratio of Java and Kotlin. The gray section is for applications rewritten from Java to Kotlin.

Employers demand Java and Kotlin

The Habr Career platform offers information on the average salary of entry-level mobile developers. The second half of 2020 showed that the salary for junior developers was 60,000 rubles. This data highlights the relevance of the mobile developer profession and the growing interest in this field.

Average salary of a junior mobile developer. Source

Of course, I'm ready to help with editing the text. Please provide the text you need to revise.

We are currently looking for an Android developer position on hh.ru, with a salary starting at 60,000 rubles. The candidate must have programming experience in Java and Kotlin. These are the key requirements for applicants who want to successfully qualify for this position. Proficiency in these languages ​​is key to developing high-quality mobile applications on the Android platform.

Android developer vacancy with a salary starting from 60 thousand rubles. Source

Let's expand the sample and analyze all vacancies on hh.ru offering newcomers salaries in the range of 40 to 80 thousand rubles. At the time of analysis, 56 vacancies are available: eight of them require knowledge of Java only, five require knowledge of Kotlin only, and 43 vacancies require skills in both Java and Kotlin.

Statistics on programming languages ​​in September 2020. Source

Java developer profession

You will learn Java programming from scratch and create web applications using the Spring framework. In six months, gain fundamental skills and build a portfolio, and we'll help you find a job.

Find out more