skip to Main Content

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?

2

Answers


  1. 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.

    Login or Signup to reply.
  2. There is some benefits of using /Kotlin/ instead of /java/ in pure kotlin project.

    1. Organizational Clarity: It clearly separates kotlin code from java, making the project structure more intuitive.
    2. Best Practices: It aligns with the community standards for Kotlin-only projects, enhancing the readability for other developers.
    3. Maintainability: It simplifies navigation and maintenance as the project grows, which reduces the potential confusion.
    4. future flexibility: It simplifies navigation and maintenance as the project grows, which reduces the potential confusion.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search