I am trying to make an app that records a video using the camera app, and then saves that video on SD card so I can play it. I have some code but I\'m lost on how to continue as
Uri contentUri="You record video uri";
try {
Date date= new Date();
android.text.format.DateFormat.format("yyyy-MM-dd_hh:mm:ss", date);
String Video_DIRECTORY = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + getString(R.string.app_name) + "/video/";
File storeDirectory = new File(Video_DIRECTORY);
try {
if (storeDirectory.exists() == false) {
storeDirectory.mkdirs();
}
} catch (Exception e) {
e.printStackTrace();
}
File storeDirectory12 = new File(storeDirectory,date+".mp4");
InputStream inputStream = getContentResolver().openInputStream(contentUri);
FileOutputStream fileOutputStream = new FileOutputStream(storeDirectory12);
copyStream(inputStream, fileOutputStream);
fileOutputStream.close();
inputStream.close();
} catch (FileNotFoundException e) {
Log.e("Exception", "" + e);
} catch (IOException e) {
Log.e("Exception", "" + e);
}