Hi,
I want to save a picture taken by the camera. In my surfaceView which shows the camera preview, I have onPictureTaken implemented as follows
Using java Syntax Highlighting
@Override
public void onPictureTaken(byte[] data, Camera camera) {
// TODO Auto-generated method stub
Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
MediaStore.Images.Media.insertImage(context.getContentResolver(), bmp, "pic", "pic");
}
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
This throws some kind of exception, not sure how to get a handle on that. Then, I wrote a separate app just to save a bitmap using the same MediaStore syntax. After running the app, I open the Pictures folder on the device, and get the message that goes like Camera class has been terminated. I can find the pic after restarting my phone though. From searching here and the google discussion groups, I got the impression that saving a pic is a big can of worms. But there's got to be a way to do it. The native camera app can do it. Can someone help please?
Thanks