Monday, July 24, 2017

Configure Kotlin Plugin to Android Studio

Kotlin is a new programming language Developed by JetBrains.

This article about
1.How to configure Kotlin plugin to Android Studio.
2. Create Hollo world App.

Install Kotlin Plugin to Android Studio 

File -> Settings -> Plugins - > Browse Repositories -> Search  -> Kotlin -> Install

Create new Android Project and Apply Kotlin Plugin to your project.

Apply Kotlin to your project

buildscript {
    ext.kotlin_version = "1.0.6" // replace with the latest (stable) version:

    repositories {
    dependencies {
        classpath ''
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
apply plugin: ''
apply plugin: 'kotlin-android' // apply kotlin android plugin

Convert Activity java code to Kotlin 

This is java code

package world.hello.kotlin.kotlinfirstproject;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {

After Conversion

package world.hello.kotlin.kotlinfirstproject

import android.os.Bundle

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {

Check out this may be help you

Related Posts Plugin for WordPress, Blogger...