I'm working on an android app and part of it records audio. My code works fine and it saves the recorded audio in the SD card using the following code:
String mediaFile = null;
mediaFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/myRecordings.mp3";
But I want to create a folder with the app name and be able to save recorded audio to that folder. Can someone tell me how to do that? I succeeded in creating the folder but I don't know how to move the mediaFile in there:
String newFolder = "/FolderName";
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
File myNewFolder = new File(extStorageDirectory + newFolder);
myNewFolder.mkdir();
mediaFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/myRecordings.mp3"
Appreciate any help. Thanks