Environment setup in Kotlin

Kotlin and Java are two different programming languages, even though Kotlin emerged from Java. Mainly these languages are used for mobile application development in Android Studio for the Android platform.

So to learn and practice those programming languages, we don’t directly need to code them on Android Studio. We can also code them in Intell J IDE, VS Code, etc. Nowadays, online compilers are acing the programming aspects.

Here’s the best source for practicing Kpotlin programming: https://play.kotlinlang.org/koans/overview.

For Java JDK (Java Development Kit), the JDK contains tools for creating and evaluating Java-based applications that run on the Java platform, which we can download from the following link: https://www.oracle.com/java/technologies/downloads/.

Apart from individual installations, Android Studio directly provides the environment for coding using both Kotlin and Java.

Let’s start with the Android Studio installation:

Click Android Studio in the search engine or go to this link: https://developer.android.com/studio.

Install android Studio on Windows

  1. Execute the file in the folder where we downloaded and saved the Android studio installation file.
  2. Click “Yes” to approve the installation if the “User Account Control” dialogue box asks if we want to enable the installation to make modifications to our computer.

widget
  1. "Welcome to Android Studio" Setup dialogue box displays accept all the default settings and click next until we see the finish. After all the setup is done, click "Finish".
widget
  1. When the Android Studio first launches, choose the preference of light or dark theme.
widget
  1. Various setup wizard downloads and additional installation components will be displayed, or pop-ups that will be displayed on the screen should be allowed and give permission to everything that comes up.
  2. Click "Allow Access" if needed to continue the installation when we receive a Windows Security Alert about adb.exe.
  3. Click "Finish" when the download and installation are completed.
  4. The "Welcome window displays, and we're all set.
widget

Install android studio on macOS

  1. Execute the installation file in the folder where we downloaded and saved Android Studio, and this pop-up appears.
widget
  1. Drag and drop the Android Studio icon into the Applications folder and click it to launch the setup wizard.
  2. Accept the installation if we see a warning about installing or running a file downloaded from the internet.
widget
  1. Various setup wizard downloads and additional installation components will be displayed, or pop-ups that will be displayed on the screen should be allowed and give permission to everything that comes up.
  2. Android Studio starts automatically after the installation completes.
  3. The "Welcome" dialogue box opens, and we are all set.
widget

Kotlin and JDK setup

In the above screen displayed, click "Create a new project", which goes into the below screen for selecting the type of activity.

widget

After selecting the activity type, a new prompt appears, including the kind of language we want to use for this project.

widget

Specify the language as either Java or Kotlin. This is how the working installation aspects on those two languages in Android Studio.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved