
Let’s create a new project and configure that project to use Kotlin now. Configuring Your Project to Use KotlinĪt this point, your IDE can understand and run Kotlin code, but you’ll still need to configure Kotlin every time you want to use it in a new project. You’ll need to restart your IDE before the Kotlin plugin becomes active, so either click the Restart Android Studio button that appears or restart your IDE manually. Select Kotlin from the menu, and then click the green Install button.

Give the Configure icon a click, and then select Plugins from the subsequent dropdown.Ĭlick the Install JetBrains plugins.

Launch Android Studio and you should see the Welcome to Android Studio window-if this window doesn’t appear, then close Android Studio completely and relaunch it. Once you’re confident that your development environment is up to date, you're ready to install the Kotlin plugin. It’s also worth opening the SDK Manager and checking whether updates are available for any of the packages you’ve installed. The very first thing you need to do is add Kotlin support to your Android Studio installation.īefore we get started, make sure you’re running the most recent, stable version of Android Studio, as you’re more likely to encounter bugs with the Kotlin plugin on experimental versions of Android Studio. You’ll also know how to avoid ever having to write another findViewById, by making use of Kotlin’s Android extensions.īut first, it's time to teach our development environment how to speak a new language! Installing the Kotlin Plugin in Android Studio By the time you reach the end of the tutorial, you’ll have created a simple Android app that displays a line of text-and is written entirely in Kotlin. In this follow-up tutorial, we're going to get started with some actual Kotlin development.

Its syntax is designed to feel very similar to Java, meaning it should be fairly easy for Java developers to get to grips with the fundamentals of Kotlin.It's 100% interchangeable with Java, to the point where you can continue to use existing Java libraries and frameworks, and can even use a mixture of Java and Kotlin code in your Android projects.In the first part of this three-part series, we looked at what Kotlin is and what it has to offer Android developers: There are a variety of modern programming languages that are designed to run on the Java Virtual Machine (JVM), and one of these languages that's becoming popular in the Java community is Kotlin. While the vast majority of Android apps are written in Java, there's no rule that you have to use Java for Android development.
