Download New Sharecodepoint Android App from Google Play Store : DocScannerPoint : Document Scanner with OCR, PDF: Download Now - programming homework help. Get your programming homework done with expert homework helper. Trust with your paper and you will never regret it.

Download Latest Notes, Study Materials and More...

Visit: Download Now

Ask Any Question Relative to your Sujbect

Visit: Ask Question

Copy all Files and Folder from Folder in Android studio.

How to copy files from the folder in android studio. please try this:

Example :

AppManifest in the project. Please allow this permission to read and write external storage.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
public static void copyFileOrDirectory(String srcDir, String dstDir) {
        try {
            File src = new File(srcDir);
            File dst = new File(dstDir, src.getName());
            if (src.isDirectory()) {
                String files[] = src.list();
                int filesLength = files.length;
                for (int i = 0; i < filesLength; i++) {
                    String src1 = (new File(src, files[i]).getPath());
                    String dst1 = dst.getPath();
                    copyFileOrDirectory(src1, dst1);
            } else {
                copyFile(src, dst);
        } catch (Exception e) {
    public static void copyFile(File sourceFile, File destFile) throws IOException {
        if (!destFile.getParentFile().exists())
        if (!destFile.exists()) {
        FileChannel source = null;
        FileChannel destination = null;
        try {
            source = new FileInputStream(sourceFile).getChannel();
            destination = new FileOutputStream(destFile).getChannel();
            destination.transferFrom(source, 0, source.size());
        } finally {
            if (source != null) {
            if (destination != null) {


Post a Comment