I\'ve just started getting into android/Glass development and I was trying to add basic video recording functionality. Currently Glass limits you to 10 seconds unless you tap/p
Open AndroidManifest file and inside application tag add this
android:requestLegacyExternalStorage="true"
I ran into the same issue on some Android devices. I was using Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES)
as the output for the MediaRecorder
instance. After reading is3av's answer, I changed the output path to Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)
and the problem is solved.
Seems like some phones don't allow files to be written to Environment.DIRECTORY_MOVIES
path or that path doesn't exist.
Change your location to:
Environment.getExternalStorageDirectory() + File.separator
+ Environment.DIRECTORY_DCIM + File.separator + "FILE_NAME";
This worked for me. Hope it helps!
Try add <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
to your AndroidManifest.xml