Getting started with Kotlin on Android Studio 3.0 +

Kotlin is fully supported in Android Studio 3.0 and higher, so it's easy to create new projects with Kotlin files, add Kotlin files to your existing project, and convert Java language code to Kotlin. 

You dont need to setup any kotlin plugins in Android studio 3.0 and higher.

You can then use all of Android Studio's existing tools with your Kotlin code, such as autocomplete, lint checking, refactoring, debugging, and more.

step 1:
 To create project in Kotlin, need to select "Include Kotlin support" checkbox in below screen.


step 2:
Here, you need to select target sdk version. This step is same as Android/Java project.


step 3:
Enter file name. This step is same as Android/Java project.


step 4:
Project setup is done. see below project structure. Kotlin/Android project structure is same as android/Java project. Only Class file name extension will be in .kt 


step 5:
Follow below option to add new kotlin class to existing project.


No comments:

Post a Comment