title: Android: How to record video using android.hardware.camera2 and MediaRecorder
body: <p>I want to make video recording using <code>android.hardware.camera2</code>. I have googled but not get any proper tutorial regarding this. There are some tutorial available for <code>camera preview</code> base on <a href="https://developer.android.com/reference/android/hardware/Camera.html" rel="nofollow noreferrer">Camera</a> which is now deprecated. Can anyone help me with latest sample code just for <code>recording video</code> with its <code>preview</code> which can be saved into <code>sd card</code>. I have just check <a href="https://github.com/googlesamples/android-Camera2Video" rel="nofollow noreferrer">GitHub</a> and <a href="https://developer.android.com/samples/Camera2Video/index.html" rel="nofollow noreferrer"> Google camera2Video example</a> also but I need any simple solution which I can integrated into my project.</p>