I’m creating an android app which saves user’s file like pdf, music, word files, pics, videos, etc

If you want to create a folder in the device, you can use this method:

public void createFfolder(String folderPath){
    File folder = new File(folderPath);
    if (!folder.exists()) {
        folder.mkdir();
    }
}

in case the folder doesn’t exists, it creates it.

Just make sure you have the WRITE_EXTERNAL_STORAGE permission in your Manifest

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

hope it helps

Leave a Comment