Skip to content Skip to sidebar Skip to footer

Creating Subdirectories Within A Directory And Be Able To Save Data Into It

I'm new to android developing, and I'm in need of help. I've got two problems which are: I don't know how to create two subdirectories inside my main directory. I know how to cre

Solution 1:

I've finally solved my problems, and here are the solutions I've done:

Stringfolder_main="Saling-Wika"FileMainDir=newFile (Environment.getExternalStorage();, folder_main);
if (!MainDir.exists()){
   MainDir.mkdirs();
}

Filef1=newFile (Environment.getExternalStorage() + "/" + folder_main, "Audio Files");
if (!MainDir.exists()){
   MainDir.mkdirs();
}

Filef2=newFile (Environment.getExternalStorage() + "/" + folder_main, "Text Files");
if (!MainDir.exists()){
   MainDir.mkdirs();
}
}

Here is the code how I've created two subdirectories (Audio & Text Files folders) inside of the main directory (Saling-Wika fodler).

outputFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Saling-Wika/Audio Files/" + format + ".3gp";

And here is how my audio files are being saved into the Audio Files folder.

Post a Comment for "Creating Subdirectories Within A Directory And Be Able To Save Data Into It"