I have an Android App developed using Java. I now want to start using Kotlin for the same app. Is it possible to use Kotlin and Java side-by-side in an existing app?
To enable Kotlin into your existing Android project. Follow these steps:-
Application-level build file:- Add
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
Add In dependency:-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Project Level build File:-
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}