At Google I/O 2017, it was announced that Kotlin will become the official language for Android development. While this news is great, it poses concerns for developers who will eventually need to update their existing Java code to the new language. Luckily, Android Studio includes a tool to make the transition more seamless by¬†actually converting a selected Java file to Kotlin. Here’s how to use it!

  1. First, update everything in Android Studio. Pretty self-explanatory there.
  2. Open up a Java code file. In the top menubar, click “Code” then “Convert Java File to Kotlin File.”¬†Please note the message about your code potentially being incorrect then click “OK.”
  3. If you get a message saying “Kotlin not configured,” simply click “Configure>Android with Gradle,” then click “OK.”
  4. Resync your Gradle
  5. and you’re done!

For more programming and general tech guides, subscribe to us on YouTube!

Leave a Reply

Your email address will not be published. Required fields are marked *