


This can help maintain consistency to have all your code in one location for any project that has or had Java code in the past.

I personally really like it for the reason that all of your source is in a single place, making it easier to find related code in a project mixed with Java.When you create a new project Kotlin project in Android Studio, it uses “src/main/java” as the location for your Kotlin code.The official documentation Android Developer Documentation recommends it, and shows additional configuration you must add to support a “src/main/kotlin” source set.Where do you put your Kotlin code in your Android project?ħ9% of people say it should go in “src/main/java”. My answer is always it depends, but let’s see why you would use “src/main/java” the majority of the time, and why you’d want to use “src/main/kotlin” in some cases. Based on the results of a poll of 371 Android developers, the majority of responses endorse using “src/main/java” for Kotlin code in Android only projects.
