With Android Studio 3.0
You don't need to install any plugin to convert java code to kotlin code. Now, Google is officially supporting Kotlin language.
- Android Studio Menu -> Code -> Convert Java File to Kotlin File
Before Android Studio 3.0
If you are using older Android Studio ( which is below version 3.0 ) there is a Kotlin tool under the menu.
Installing Kotlin plugin :
- Android Studio Menu -> File -> Settings -> Plugins -> Browse repositories -> Kotlin
Converting Java Code to Kotlin Code :
- Select your java class file from project structure.
- Android Studio Menu -> Code -> Convert Java File to Kotlin File
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…