Kotlin or Java?
You are about to build Sprout, a small app that reminds you when to water your plants. Before the first line, you must pick a language. Android gives you two real choices, and the decision is easier than it looks.
The rule
Write new code in Kotlin; Java still runs beside it.
Kotlin is Google's recommended language for Android. Most new libraries, documentation and samples are written for it, and Jetpack Compose, the modern way to build screens, can only be used from Kotlin.
Java was Android's original language. Millions of lines of existing apps are written in it, and it is still fully supported.
The two are not rivals inside a project. Both compile to JVM bytecode, which the Android build then turns into DEX files that the device runs. So a Kotlin class can call a Java class and the other way round:
// Kotlin file calling an old Java helper
val days = WateringCalculator.daysUntilDry(plant) // WateringCalculator.javaKotlin also removes whole groups of bugs: types are non-null unless you add ?, so the compiler catches many null mistakes before the app ever runs.
The shortcut
Ask one question: is this new code, or existing code?
New screen
You are writing the plant list from scratch. New code → Kotlin, and you can use Compose.
The trap is thinking you must rewrite a Java app before adding Kotlin. You never have to: mixing is normal.
Drills
Answer fast — trust the rule.
Which language does Google recommend for new Android code?
A project has 40 Java files. Can you add a new Kotlin file to it?
Why can Kotlin code call a Java class directly?
You want to build Sprout's screens with Jetpack Compose. Which language must those screens use?
Remember
- Write new code in Kotlin; Java still runs beside it.
- New code → Kotlin. Existing working Java → leave it, convert when you touch it.
- Never rewrite a Java app just to start using Kotlin.
