I have an app in which I need to save my images into sdcard after taking them from camera.
Here is the code:
camera.takePicture(myShutterCallback, myPictureCallback_RAW,
myPictureCallback_JPG);
PictureCallback myPictureCallback_JPG = new PictureCallback() {
@Override
public void onPictureTaken(byte[] arg0, Camera arg1) {
Bitmap bitmapPicture = BitmapFactory.decodeByteArray(arg0, 0,
arg0.length);
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream(UploadedFilename);
} catch (FileNotFoundException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
final Bitmap result = Bitmap.createScaledBitmap(bitmapPicture, 640,
480, false);
The code bombs on this line:
Bitmap bitmapPicture = BitmapFactory.decodeByteArray(arg0, 0, arg0.length);
It says its :
Exception class java.lang.OutOfMemoryError Source method BitmapFactory.nativeDecodeByteArray().
Please Help