1
我已经从对应于视频文件Android图库将视频保存到内部存储
VideoView videoView1 = (VideoView)promptsView.findViewById(R.id.videoView09);
String SrcPath = "/storage/emulated/0/DCIM/Camera/20150824_210148.mp4";
videoView1.setVideoPath(SrcPath);
videoView1.requestFocus();
videoView1.start();
现在内的路径起着视频videoView,我需要以某种方式将视频从这个videoView商店内部存储我的应用程序私人。
我已经成功地为照片做到这一点使用
public String saveImageToInternalStorage(Bitmap image, String imgRequestedName) {
ContextWrapper cw = new ContextWrapper(getActivity());
File directory = cw.getDir("imageDir", Context.MODE_PRIVATE);
File mypath=new File(directory,imgRequestedName+".jpg");
String loc = mypath.getAbsolutePath();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(mypath);
image.compress(Bitmap.CompressFormat.JPEG, 70, fos);
SharedPreferences pref = getActivity().getApplicationContext().getSharedPreferences("MyPref", Context.MODE_PRIVATE);
final SharedPreferences.Editor editor = pref.edit();
editor.putInt("totalImageCount",(pref.getInt("totalImageCount",0))+1);
editor.commit();
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
return mypath.getAbsolutePath();
}
我怎样才能做视频的相同呢?
以及如何从内部存储器读取视频?