I am attempting to create a Directory for my apps data which will be .txt files. At this point, I don't care if it is on the Internal and or External Storage. I have been searching all over for a solution and I can't find anything that works. MkDir() or MKDirs() has not worked for me.
The code I have posted is just the first of many attempts to resolve this problem. I keep trying to change the directory path. It will Detect that existing paths are there but If I set it to the path I desire to create it will not work. I do have permission to read and write external storage in my Manifest I tried to find code to request permission at runtime with no success. So I manually allowed storage through the device's settings for the app and still nothing.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
val f = File("/TestFolder")
if (f.exists() && f.isDirectory()) {
println("Exists")
} else {
f.mkdir()
println("Does Not Exist.")
}