Language Differences

When you import an Android project into Android Studio, you get whatever source code was in that project. This could be Java, Kotlin, or some combination.

When you create a project from scratch — as we will examine in an upcoming chapter — you will be able to tell the new-project wizard whether you want it to generate Java or Kotlin files. When you start working on adding new stuff to your project, you can add in new Java or Kotlin files.

The HelloWorld sample project that you imported was created using the Android Studio Arctic Fox new-project wizard, where the author asked for Kotlin files. Therefore, our two test source sets and the main source set contain Kotlin.

If you would prefer, you can download a Java edition of the same project from the CommonsWare site. UnZIPping and importing that project gives you the same thing as the HelloWorld Kotlin project, except that the source code (main/, androidTest/, and test/) is Java, not Kotlin.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.