How to create folder (for example in the folder "Documents" in my phone), in this folder create the file and write data in this file? I have a code. But I am not shure that I do my file path is right. I want create folder and file not at SD card / I want do it in the device memory.
var filePath = File(Environment.DIRECTORY_DOCUMENTS + "myFolder/myFile.txt")
                filePath.mkdirs()
          
                try {
                    var outPut = FileOutputStream(filePath)
                    outPut.write("Hello")
                    outPut.close()
                } catch (e: Exception) {
                    e.printStackTrace();
                }
 
    