Make sure you have the WRITE_EXTERNAL_STORAGE permission. On Sat, Oct 30, 2010 at 3:02 PM, John Gaby <[email protected]> wrote: > Thanks for the input. I decided that the SD card is the proper place > for the files anyway, so I am trying to make that work. Since I want > to support pre 2.2 versions, I am doing the following: > > String state = Environment.getExternalStorageState(); > > if (Environment.MEDIA_MOUNTED.equals(state)) > { > File root = Environment.getExternalStorageDirectory(); > File ext = new File(root, "Android/data/" + > m_activity.getPackageName() + "/files/"); > boolean b = ext.mkdirs(); > String s = ext.getAbsolutePath(); > > ... > > Unfortunately, the ext.mkdirs() call is returning false, and the > directories are not being created. I did a web search, and it seems > like this is the proper way to create my directory. Do you have any > idea why it is not working for me?
-- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 2.2 Programming Books: http://commonsware.com/books -- 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

