Configure Android Studio 2.3.2 for Kotlin
Step Number 1 :
Check the Android Studio version of your machine.My android studio version is 2.2.3 and it' s a stability release of android studio.So I did this tutorial for android studio 2.2.3
Step Number 2 :
In your android studio go to File -> Settings -> Plugins and click Browse Repositories and then search for Kotlin
Step Number 3 :
Check the Android Studio version of your machine.My android studio version is 2.2.3 and it' s a stability release of android studio.So I did this tutorial for android studio 2.2.3
Step Number 2 :
In your android studio go to File -> Settings -> Plugins and click Browse Repositories and then search for Kotlin
Click the
"Install" button. After that we need to restart Android Studio to complete installation.
Step Number 3 :
Create a simple Android Studio project.
In your Android Studio go to File -> New -> New Project
Enter the details, Apllication name as a My First Kotlin Dev and Company domain fill as a com.prihanofficial.You can put your own Apllication name and Company domain to your project and select "Next" Button.
Click "Next" Button
Select a Empty Activity and click "Next" Button
Click on the "Finish" button
Step Number 4 :
Default MainActivity.java class in java folder.It contains this kind of code segment.
Step Number 5 :
Convert MainActivity.java file in to MainActivity.kt
Select a
MainActivity.java class of java falder in your project and select Code -> Convert Java File
to Kotlin File.Then you can get following code segment inside a MainActivity.
Step Number 6 :
Go to Gradle Scripts and Select build.gradle(Module:app)
In your android studio go to Tools -> Kotlin ->Configure kotlin in Project
In your android studio go to Tools -> Kotlin ->Configure kotlin in Project
Write A Simple Hello World Inside MainActivity.kt
Go to your MainActivity and type this this inside a onCreate andrun the project.
Simple Input output program using kotlin
Apply this code to your activity_main.xml
Add the this code sgment to your MainActiity.kt file and simply run your project.