Apache FileUtils makes it very simple and beautiful.
enable apache package for sharing add commons-io.jar
or
commons-io android gradle dependency
compile 'commons-io:commons-io:2.4'
Add this code
String sourcePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/TongueTwister/sourceFile.3gp"; File source = new File(sourcePath); String destinationPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/TongueTwister/destFile.3gp"; File destination = new File(destinationPath); try { FileUtils.copyFile(source, destination); } catch (IOException e) { e.printStackTrace(); }
source share