Building iOS, Android & Flutter apps for clients in the USA · UK · UAE · Worldwide +92 333 9799025WhatsAppjunaidtariqlhrpk@gmail.com
Frameworks

Kotlin vs Java for Android Development

Kotlin or Java for your Android app? What Kotlin-first means in practice, interop traps, an incremental migration plan, and when Java is still fine.

For a new app, the kotlin vs java for android question has a short answer: write it in Kotlin. Google builds its Android libraries, samples and UI toolkit with Kotlin users in mind, and the recommended UI toolkit cannot be written in Java at all. The harder question is what to do with a Java codebase that already earns money, and that is where most of the budget decisions sit.

This post is for product owners and CTOs who own an Android app and need to plan the next year of work. It covers what differs between the languages in day-to-day code, the interop traps in mixed projects, a migration plan that does not stop releases, and the cases where leaving Java alone is the right call. The language-level case for Kotlin is on our Kotlin app development page, and the Java side is covered under Java app development. Here we go one level more practical.

Where the decision stands in 2026

Google announced in 2019 that Android would become Kotlin-first. Its own page on what Kotlin-first means is specific: new Jetpack libraries, samples, documentation and training are designed with Kotlin users in mind, while Google continues to support calling its APIs from Java. The same page lists Jetpack Compose as “No” for Java and “Yes” for Kotlin, and marks samples and training for Java as best effort.

That is the practical shift. Java still compiles, still runs and still ships on Google Play. But every new screen built in Compose needs Kotlin, and every new sample your developers copy from the documentation assumes it. A Java-only team is now translating the platform’s guidance before using it.

Google also publishes adoption figures. According to Google’s Kotlin page, Kotlin is used by over 60% of professional Android developers and 95% of the top 1,000 Android apps contain Kotlin code. Google also reports that top-1,000 apps using Kotlin have 20% fewer crashes. Treat that last figure as Google’s correlation, not a guarantee for your app: crash rates depend on architecture and testing far more than on syntax.

On tooling, Kotlin 2.0 shipped in May 2024 with the stable K2 compiler, which JetBrains says can potentially double compilation speed, with results varying by project. From Kotlin 2.0 the Compose compiler also lives in the Kotlin repository and releases alongside each Kotlin version, which removed a version-matching headache that used to block upgrades. As of October 2026 the current release is Kotlin 2.4.20.

Kotlin vs Java for Android: side-by-side comparison

How the two languages compare on the things that change cost, quality and hiring for an Android product. This is about Android apps, not server-side Java.

Factor Kotlin Java
Google’s position Kotlin-first; docs, samples and new libraries designed for it Supported for calling Android APIs; samples best effort
Modern UI Jetpack Compose (Kotlin only) XML Views; Compose needs Kotlin files
Null handling Nullable and non-null types checked by the compiler Any reference can be null unless annotated
Async work Coroutines and Flow, scoped to the screen or ViewModel Executors, callbacks or RxJava; cancellation is manual
Data and state classes data class, sealed types, exhaustive when Hand-written classes or code generation
Annotation processing KSP for libraries that support it; kapt as a fallback Standard Java annotation processors
Sharing with iOS Kotlin Multiplatform for shared business logic No equivalent route
Hiring for Android The skill current Android developers are trained in Common among developers who maintain older apps and backends

Both compile to bytecode for the Android runtime, and Google describes Kotlin as 100% interoperable with Java in one project. The decision is about where new code goes, not about throwing old code away.

Four differences that show up in production code

Syntax comparisons miss the point. These are the differences that change bug counts and review time on an Android team.

Null safety at the boundary, not just inside Kotlin

Inside Kotlin, a String cannot be null and a String? must be checked before use. The compiler enforces it. The catch is Java code: Kotlin sees un-annotated Java values as platform types, and treats them as “could be either”. A Kotlin file that calls a Java helper returning null can still crash with a NullPointerException. In mixed projects, adding @Nullable and @NonNull annotations to the Java classes Kotlin calls most is one of the cheapest stability fixes available.

Coroutines replace hand-managed threads

Older Java Android code moves work off the main thread with executors, callbacks, deprecated AsyncTask or RxJava chains. Each one makes cancellation the developer’s job. Kotlin coroutines tie background work to a scope such as a ViewModel, so leaving a screen cancels the request instead of writing to a view that no longer exists. That one change removes a whole family of “crash after rotation” and “stale result” bugs.

Sealed types make screen state explicit

A screen is usually loading, empty, showing content or showing an error. In Kotlin that becomes a sealed interface, and a when expression fails to compile if a state is not handled. In Java the same idea is a set of booleans or an enum plus nullable fields, and the missing case is found by a user.

Less code per feature

Data classes, default arguments, extension functions and named parameters remove a lot of boilerplate. Fewer lines are not valuable in themselves, but less code means smaller pull requests and faster review, and review time is where Android teams lose days.

Key takeaway

New Android code should be Kotlin. Existing Java should be converted when it is touched for another reason, starting at the boundaries Kotlin calls most. A full rewrite is almost never the cheapest route to a Kotlin codebase.

When Java is still fine

Kotlin being the default does not make Java a problem to fix at any cost. Google’s own Kotlin FAQ answers “Kotlin or Java?” with “You don’t have to pick! You can use both.” These are the cases where we leave Java in place.

  • Stable modules nobody changes. A payment wrapper or image pipeline that has worked for years and has no roadmap items does not need converting. Spend the budget where change happens.
  • An app with a short remaining life. If the product is being replaced within a year, convert nothing. Keep it compliant and stable.
  • Shared Java libraries used by a backend team. If a validation library is also used by a Spring Boot service, keeping it in Java can be the simpler contract.
  • A Java-only team under a hard deadline. Learning Kotlin mid-release adds risk. Ship, then start the move in the next cycle.

What does not count as a reason: “our Java works”. It does, until the next feature needs Compose, a Kotlin-only library or a developer who would rather not maintain Java. Then the cost lands all at once.

Migrating a Java codebase to Kotlin without freezing releases

The sequence we use in Android app upgrade services. Each step ships through Play internal testing, and feature work continues alongside it.

Baseline the app

Record target API level, Gradle and Android Gradle Plugin versions, crash and ANR rates from Play Console, test coverage and the share of Java vs Kotlin files. Google Play requires new apps and updates to target API 36 from 31 August 2026, so a Java app that is behind usually has compliance work to do first.

Add Kotlin to the build

Apply the Kotlin plugin, pick a current Kotlin version and set lint and formatting rules for Kotlin files. Since Kotlin 2.0 the Compose compiler comes with Kotlin, so plan Kotlin and Compose upgrades together.

Annotate the Java boundaries

Add nullability annotations to the Java classes Kotlin will call first, such as repositories, models and API clients. This turns platform types into checked types and prevents the most common mixed-project crash.

Write all new code in Kotlin

New features, tests and screens start in Kotlin. This is the rule that moves the codebase without a dedicated rewrite budget.

Convert on touch, with tests first

When a Java class needs changing, write or update its unit tests, then convert it. Android Studio’s Java-to-Kotlin converter is a starting point; its output needs review for !! operators and nullable types it could not infer.

Move async code to coroutines at the ViewModel layer

Replace callbacks and executors with coroutines in ViewModels and repositories first, where cancellation bugs live. Wrap callback-based Java APIs instead of rewriting them.

Introduce Compose screen by screen

Once screens have Kotlin ViewModels, new or frequently changed screens move to Compose. Our Jetpack Compose vs XML guide covers that step in detail.

Inherited a Java Android app?

Share repository access or a module list. We reply within one business day with what to keep in Java, what to convert first and what the next Play deadline means for your release plan.

Interop traps in mixed Java and Kotlin projects

Google describes Kotlin as 100% interoperable with Java, and it is. Interoperable still means someone has to know where the seams are. These are the issues we check for in mixed codebases.

Java calling Kotlin

  • Companion objects. Without @JvmStatic, Java callers write Foo.Companion.bar(). Add the annotation on anything Java code still uses.
  • Default arguments. Java cannot see Kotlin default parameters unless the function has @JvmOverloads. Otherwise every Java call must pass every argument.
  • Checked exceptions. Kotlin has none, so Java callers cannot catch an IOException from a Kotlin function unless it declares @Throws.
  • Properties. Kotlin properties appear as getters and setters in Java. Use @JvmField only where a plain field is needed.

Build and tooling

  • Annotation processors. Room, Dagger and similar libraries run through kapt in Kotlin modules unless you move to KSP where the library supports it. kapt is slower, so check each processor’s KSP support before a large conversion.
  • Lombok. Kotlin code cannot always see Lombok-generated Java members. Convert Lombok-heavy model classes to Kotlin data classes early.
  • Module structure. Converting one feature module at a time keeps incremental builds fast and makes the conversion easy to review.

When we’d pick each

Match your situation to a row. The health of the codebase matters more than its language.

Your situation Recommendation Why
New Android app Kotlin with Jetpack Compose Platform direction, Compose, coroutines, hiring
Healthy Java app with an active roadmap Kotlin for new code; convert on touch Progress without a rewrite budget
Java app with logic inside Activities Refactor into ViewModels, in Kotlin Fixes architecture and language together
Java app being retired within a year Stay in Java; keep it compliant Conversion would not pay back
Android app plus a planned iOS app Kotlin, then consider Kotlin Multiplatform Shared business logic is Kotlin only
Java SDK shipped to other developers Keep the public API Java-friendly Your customers may still be on Java

If an iOS app is on the roadmap, our Kotlin Multiplatform vs Flutter comparison covers the next decision.

Hiring, handover and the iOS question

Android developers trained in the last few years learn Kotlin and Compose first. A Java-only Android codebase narrows the pool of people who will want to maintain it, and the same applies when you hand the app to a new vendor. A mixed codebase with clear rules (new code in Kotlin, Java converted on touch) is easy to hand over. A mixed codebase with no rules is not.

When we screen Android engineers, Kotlin is assumed. The useful questions are about seams: how they would call a callback-based Java SDK from a coroutine, what a platform type is and how they handle it, and how they would move a Java module to KSP. If you need people rather than a project team, you can hire Kotlin developers with a two-week trial under the agreement.

Kotlin also opens a route Java does not: Kotlin Multiplatform, which shares business logic such as pricing rules, validation and sync with a Swift iOS app. If that matters to you, read Kotlin Multiplatform vs Flutter before committing to a second codebase.

Kotlin vs Java for Android: planning checklist

Answer these before estimating any conversion work.

  • What share of the codebase is Java, and which modules changed most in the last six months?
  • Does the app meet the current Play target API requirement, or is that the first job?
  • Are the Java classes Kotlin calls annotated for nullability?
  • Which annotation processors run through kapt, and do they support KSP?
  • Is business logic in ViewModels, or inside Activities and Fragments?
  • Is there unit test coverage on the classes you plan to convert first?
  • Will new UI be built in Compose, and does the team have production Compose experience?
  • Is an iOS app planned that could share Kotlin business logic?
  • Are crash and ANR rates tracked in Play Console so you can see the effect of each change?

Kotlin vs Java for Android: frequently asked questions

Is Java still supported for Android development?

Yes. Google continues to support calling Android APIs from Java, and Java apps still ship on Google Play. What changed is the direction: Android has been Kotlin-first since 2019, new Jetpack libraries and samples are designed for Kotlin, and Jetpack Compose cannot be written in Java. Java is fine to maintain; it is a poor choice for new Android code.

Can Kotlin and Java be used in the same Android app?

Yes. Google describes Kotlin as 100% interoperable with Java, so one project can contain both and call between them. The work is at the seams: nullability annotations on Java code, @JvmStatic and @JvmOverloads on Kotlin code that Java calls, and a plan for annotation processors. With those in place, mixed projects are routine.

Should we rewrite our Java Android app in Kotlin?

Usually not in one go. Write new features in Kotlin and convert Java classes when they change for other reasons, with tests written first. A full rewrite only makes sense when the architecture blocks required work, such as target API upgrades, and then it is the architecture you are replacing, not just the language.

Is Kotlin faster than Java on Android?

Both compile to bytecode that runs on the same Android runtime, so the language alone rarely decides runtime speed. The differences you notice are in development: fewer null-related crashes, simpler async code with coroutines, and less boilerplate. JetBrains says the K2 compiler in Kotlin 2.0 can potentially double compilation speed, with results varying by project.

Do I need Kotlin to use Jetpack Compose?

Yes. Google’s Kotlin-first comparison lists Jetpack Compose as available for Kotlin and not for Java. A Java app can still host Compose screens, but those screens must be written in Kotlin files. That is why adding Kotlin to the build is usually the first step of any Android UI modernisation, even when most existing code stays in Java for a while.

Plan your move to Kotlin with a clear sequence

Tell us about your Android app. We reply within one business day with a module-by-module plan: what stays in Java, what converts first and where Compose fits. See how we approach Kotlin app development for new builds.

Leave a Reply

Your email address will not be published. Required fields are marked *

WhatsApp Call