android camera video 怎么保存onPreviewFrame(byte[] data, Camera camera)中的data到手机本地
http://www.cnblogs.com/kgdxpr/p/3595518.html
try {
File dir = new File(Environment.getExternalStorageDirectory().getPath());
if(!dir.exists()&&dir.isDirectory()){//判断文件目录是否存在
dir.mkdirs();
}
File savefile = new File(Environment.getExternalStorageDirectory().getPath()+"\"+"myvideo.dat");
FileOutputStream fos= new FileOutputStream(savefile);
fos.write(data);
fos.close();
} catch (FileNotFoundException e) {
return;
}
catch (IOException e){
return ;
}
我傻了,反斜杠。。。。