Kotlin & Android: A Brass Tacks Experiment, Part 1

Configuring an Android Project with Kotlin

buildscript {
ext.kotlin_version = '1.0.0'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

From Java to Kotlin the Easy Way

MainActivity converted from Java to Kotlin
MainActivity moved from java source dir to kotlin source dir

--

--

--

firebase-consultant.com, Firebase GDE, engineer, developer advocate, Xoogler

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Doug Stevenson

Doug Stevenson

firebase-consultant.com, Firebase GDE, engineer, developer advocate, Xoogler

More from Medium

Android Jetpack DataStore 101

Kotlin for Android Development(Part-2)

Integrate Version catalog in Android

Dialog in Android Jetpack Compose with MVVM