Answer the question
In order to leave comments, you need to log in
How to install kotlin library?
I want to use ktor in my project.
But I don’t know how to install this library for my project.
I saw some maven / gradle options, but I didn’t find a normal explanation for a beginner.
ktor:
https://www.codeflow.site/en/article/kotlin-khttp
https://ktor.io/
Here is the project root
Answer the question
In order to leave comments, you need to log in
1. Translate the project to gradle. To do this, first we put this same gradle, then we create a folder, go there in the console and write
gradle init
There will be something like this.
Starting a Gradle Daemon (subsequent builds will be faster)
Select type of project to generate:
1: basic
2: application
3: library
4: Gradle plugin
Enter selection (default: basic) [1..4] 2
Select implementation language:
1: C++
2: Groovy
3: Java
4: Kotlin
5: Swift
Enter selection (default: Java) [1..5] 4
Select build script DSL:
1: Groovy
2: Kotlin
Enter selection (default: Kotlin) [1..2] 2
Project name (default: rm_me): moy_proekt
dependencies {
implementation("io.ktor:ktor-server-netty:1.3.2")
}
Use Android Studio, if you write a mobile phone, Gradle is added to the project out of the box.
Next, add the library to buide.gradle:
implementation("название библиотеки:версия)
For HTTP, Retrofit2 is better.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question