dear everyone:

I am writing a application using the camera. but sometimes the picture
can not be stored into the SDcard, sometime the picture exsit,
sometime not. how to solve this problem? how to get high writing
priority?

there is the code:

PictureCallback jpegCallback = new PictureCallback() {
                public void onPictureTaken(byte[] data, Camera camera) {

                        FileOutputStream outStream = null;
                        try {
                                // write to local sandbox file system
//                              outStream =
CameraDemo.this.openFileOutput(String.format("%d.jpg",
System.currentTimeMillis()), 0);
                                // Or write to sdcard


                                outStream = new 
FileOutputStream(String.format("/sdcard/
funnycamera/%d.jpg", System.currentTimeMillis()));
                                outStream.write(data);
                                outStream.flush();
                                outStream.close();


                                Log.d(TAG, "onPictureTaken - wrote bytes: " + 
data.length);
                        } catch (FileNotFoundException e) {
                                e.printStackTrace();
                        } catch (IOException e) {
                                e.printStackTrace();
                        } finally {
                        }
                        Log.d(TAG, "onPictureTaken - jpeg");
                }
        };

}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to