kotlinandroid-studio

Benefit to using /kotlin/ instead of /java/ in a pure Kotlin project in Android Studio?


When creating a new package in Android Studio, it suggests a number of directory names including kotlin. This makes it seem like there is a point to having a /kotlin/ package. The default Android Studio creates, even if you select Kotlin in the setup wizard, is to put all the files in /java/ though.

What is the point of the /kotlin/ package? Is there a benefit to using it instead?


Solution

  • There hasn't been any functional difference between using src/main/java or src/main/kotlin to Kotlin Gradle Plugin in a long time.

    The only benefit is for your own personal sanity to have some separation between .java and .kt source files.