Hi Wahib,

E/PictureDemo(  739): java.io.FileNotFoundException: /sdcard/DCIM/
Camera/20091124043522.jpeg

You have to launch a emulator with sdcard. Try to launch a emulator
with SDCard and try. Then create the directories, "DCIM" and "Camera"
after that, insert the image to that location.

Thanks

On Nov 24, 9:43 am, wahib <[email protected]> wrote:
> hi !! I intend to take camera pic and save it. This is the code which
> saves the image file.
>
>         String filename;
>                  Date date = new Date();
>                  SimpleDateFormat sdf = new 
> SimpleDateFormat("yyyyMMddHHmmss");
>                  filename =  sdf.format(date);
>
> File photo=new File(Environment.getExternalStorageDirectory(),"/DCIM/
> Camera/"+filename+".jpg");
>
>                 try {
>                         FileOutputStream fos=new 
> FileOutputStream(photo.getPath());
>                         //
>
>                         fos.write(jpeg[0]);
>                         fos.close();
>                         Log.e("ooey", "last thing");
>
>                 }
>                 catch (java.io.IOException e) {
>                         Log.e("PictureDemo", "Exception in photoCallback", e);
>                 }
>
> in logcat this is displayed ...
>
> E/PictureDemo(  739): Exception in photoCallback
> E/PictureDemo(  739): java.io.FileNotFoundException: /sdcard/DCIM/
> Camera/20091124043522.jpeg
> E/PictureDemo(  739):   at
> org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
> 231)
> E/PictureDemo(  739):   at java.io.FileOutputStream.<init>
> (FileOutputStream.java:96)
> E/PictureDemo(  739):   at java.io.FileOutputStream.<init>
> (FileOutputStream.java:169)
> E/PictureDemo(  739):   at java.io.FileOutputStream.<init>
> (FileOutputStream.java:147)
> E/PictureDemo(  739):   at com.example.myfirstapp.myfirstapp
> $SavePhotoTask.doInBackground(myfirstapp.java:135)
> E/PictureDemo(  739):   at com.example.myfirstapp.myfirstapp
> $SavePhotoTask.doInBackground(myfirstapp.java:1)
> E/PictureDemo(  739):   at android.os.AsyncTask$2.call(AsyncTask.java:
> 185)
> E/PictureDemo(  739):   at java.util.concurrent.FutureTask$Sync.innerRun
> (FutureTask.java:256)
> E/PictureDemo(  739):   at java.util.concurrent.FutureTask.run
> (FutureTask.java:122)
> E/PictureDemo(  739):   at java.util.concurrent.ThreadPoolExecutor
> $Worker.runTask(ThreadPoolExecutor.java:648)
> E/PictureDemo(  739):   at java.util.concurrent.ThreadPoolExecutor
> $Worker.run(ThreadPoolExecutor.java:673)
> E/PictureDemo(  739):   at java.lang.Thread.run(Thread.java:1060)
>
> Kindly help , why File() function is not working and not creating a
> file.

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en

Reply via email to