Click on "File" in the top-left corner of the menu. Select "New" > "New Project". In the "New Project" wizard, select "Kotlin/JVM" as the project type. Enter a name for your project (e.g., "KotlinConsoleApp"). Specify the project location where you want to save your project. Ensure the language is set to Kotlin. Choose the JDK (Java Development Kit) you have installed. If you don't have one set up, you can download and configure it. Click "Finish" to create the new project. In the "Project" view on the left side, right-click on the src folder. Select "New" > "Kotlin File/Class". Enter a name for your Kotlin file (e.g., "Main"). Choose "File" as the type. Open the newly created Kotlin file (e.g., Main.kt). Write your Kotlin code in the file. For example: kotlin
Copy code
fun main() {
println("Hello, World!")
}
Run the Kotlin Application: Right-click on the Main.kt file. Alternatively, you can create a new run configuration by going to "Run" > "Edit Configurations...", clicking the "+" icon, selecting "Kotlin", and setting the main class to MainKt. Here's a step-by-step visual guide to these instructions:
Run the Kotlin Application: Following these steps will allow you to create and run a Kotlin console application in Android Studio.