Hi all,
i am using lg optimus for taking camera and saving it ..
with input stream its giving exception in     out = new
FileOutputStream(destination); this line can antbody help regarding this



InputStream in = null;
        OutputStream out = null;
        try {
            File sd = new File(sourceFile);
            if (sd.exists() && sd.canRead()) {
                File destination = new File(new File(context.getDir(
                        "CameraAppRootDir", Context.MODE_WORLD_READABLE),
                        "CameraAppUserDir"), fileName);
                in = new FileInputStream(sd);
                out = new FileOutputStream(destination);
                byte[] buf = new byte[1024];
                int len;
                while ((len = in.read(buf)) > 0) {
                    out.write(buf, 0, len);
                }
                // in.close();
                // out.close();

                Log.i("CAMERA APP ACTIVITY ", "FILE WRITTEN : " + fileName);
            } else {
                Log.e("Update Manager :saveBitMap ", "Can not read file");
            }
        } catch (Exception e) {
            Log.e("Update Manager :saveBitMap ",
                    "UpdateManager could not write data to disk for filename
="
                            + fileName);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }
            if (out != null) {
                try {
                    out.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

            }
        }

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

Reply via email to