I need to save a captured image from camera on a tmp file and retrieve it on the next activity, so i can handle better the OOM error.
So i did something like this to write the file:
public void savePicAtFile(Bitmap pic){
FileOutputStream out = null;
try {
out = new FileOutputStream("tmpCameraPic");
pic.compress(Bitmap.CompressFormat.JPEG, 100, out); // bmp is your Bitmap instance
// PNG is a lossless format, the compression factor (100) is ignored
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
now i don't know how to retrieve the compressed image, should i just create a bitmap and getall the stream?
Any help?