ローカルに保存
private Camera.PictureCallback mCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { try { FileOutputStream out = openFileOutput(file_path, Context.MODE_PRIVATE); out.write(data); out.close(); } catch (IOException e) { e.getMessage(); } } };
SDカードに保存
String filePath = Environment.getExternalStorageDirectory() + "/a.jpg"; File file = new File(filePath); file.getParentFile().mkdir(); try { out = new FileOutputStream(file, true); bmp.compress(Bitmap.CompressFormat.JPEG, 80, out); out.close(); } catch (Exception e) { e.printStackTrace(); } if (bmp != null) { bmp.recycle(); bmp = null; } }