I would like to write a file to the SD card from my application, but
the following code throws an IOException when debugged on a T-Mobile
G1:

String p = Environment.getExternalStorageDirectory() + "/log.txt";
File recfile = new File(p);
recfile.createNewFile();

The last line throws an IOException with detailMessage = "Cannot
create: /sdcard/log.txt".  The MOUNT_UNMOUNT_FILESYSTEMS permission is
set in the manifest.  And yes, I really do want to write to the SD
card; I don't want to use the logging features Android includes for
this particular application.  The Android documentation does not seem
to give any specifics on how one might write files to removable
storage in "Data Storage" under "Framework Topics".  What am I doing
wrong, or where can I read more about this topic?

Thanks,
Ben

--~--~---------~--~----~------------~-------~--~----~
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