Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
How to get the current working directory in Kotlin?

I need to know the full path of my current working directory of my simple application using Kotlin.

over 4 years ago · Hanz Gallego
3 answers
Answer question

0

This will provide the full absolute path from where application will run.

import java.nio.file.Paths

val path = Paths.get("").toAbsolutePath().toString()       
over 4 years ago · Hanz Gallego Report

0

You can also get it from System.

val path = System.getProperty("user.dir")
over 4 years ago · Hanz Gallego Report

0

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.

over 4 years ago · Hanz Gallego Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!