Converting Java code to Kotlin code

From the menu select CodeConvert Java File to Kotlin File and kaboom! Your task is done. Your first Kotlin activity is ready. As a means of verifying everything is fine, we suggest you run the project once. If you can see Hello World on the emulator or device that means you have successfully configured Kotlin for Android.

Or, create a new Kotlin file (File NewKotlin File/Class), and then paste your Java code into that file, when prompted, click Yes to convert the code to Kotlin. You can check Don't show this dialog next time, which makes it easy to dump Java code snippets into your Kotlin files:

Have a watchful eye on such conversion that IDE is doing for you. With great power comes great responsibility ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.