How to record video in the internal storage?

private static final int VIDEO_CAPTURE = 101; Uri videoUri; public void startRecordingVideo() { if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) { Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); File mediaFile = new File( Environment.getExternalStorageDirectory().getAbsolutePath() + "/myvideo.mp4"); videoUri = Uri.fromFile(mediaFile); intent.putExtra(MediaStore.EXTRA_OUTPUT, videoUri); startActivityForResult(intent, VIDEO_CAPTURE); } else { Toast.makeText(this, "No camera on device", Toast.LENGTH_LONG).show(); } } 
  • You have something not working the way you want. This is all that is clear from the question. In addition to the code, provide a description of what is happening, expectations and results - YuriySPb
  • getExternalStorageDirectory () - writes to the SD card, and what method writes to the internal storage? I do not need to write video on the SD card with Camera but only in the memory of the device - mtb
  • one
    getFilesDir () like - YurySPb

0