I need to know the full path of my current working directory of my simple application using Kotlin.
I need to know the full path of my current working directory of my simple application using Kotlin.
This will provide the full absolute path from where application will run.
import java.nio.file.Paths
val path = Paths.get("").toAbsolutePath().toString()
If you are working with kotlin on android try with:
Kotlin
applicationInfo.dataDir
if you are working on android using Java.
getApplicationInfo().dataDir
it returns a String.