Tech tip of this week

Kotlin Programming Language Support in Android

What is Kotlin?
Kotlin is programming language developed by Jet brains. 

How to set up Kotlin in Android Studio?
Kotlin plugin is bundled with Android Studio 3.0 version. To support kotlin for previous Android studio versions, you need configure Kotlin plugin manually.

How to program Kotlin?
Create new project in Android studio the way you created for Android project.
You can select "Include kotlin support" to create kotlin files by default.

Configure Kotlin in application build.gradle files. Check below 2 screen shot for kotlin configuration.

Open any .java file and Ctrl + Shift + A (Find Action), type "convert java to kotlin file". After this action, java file will be converted to kotlin file. See below screenshot.

you can also have .java and .kt files in same application project.

No comments:

Post a Comment