In an Android app the user can record his voice. The sound recording is saved in a file defined by:
audioTempFile = File(getFilesDir(), "Audio_Temp_File")
Then I want to give the user the choice of the final folder and file name for the file to be saved. So the audioTempFile above can be used for a possible next recording without destroying the current one.
For example let us assume I want the file to be saved in this file called finalFile :
val rootDir = getFilesDir()
val storeDir = File(rootDir, "MyStorageDirectory")
val finalFile = File(storeDir, "MyFinalFileName")
How can I move or possibly copy audioTempFile to finalFile?
I did not find any clear answer by searching the net.
I don't know about saving to a specific location, but this is the way I'm saving the recordings in my app.
You would need
MANAGE_EXTERNAL_STORAGEpermission if u want to save files other than public directories. It's recommended to use MediaStore API to save your files.Do correct me if I'm wrong as I'm still learning.
Hope this helps u :)