[android-developers] Re: FileNotFoundException

2011-02-25 Thread davemac
Yup. I suspect it's in mkdirs() also. If there's a file called widgets on the SD card, your code won't work. - dave On Feb 25, 12:47 pm, TreKing treking...@gmail.com wrote: On Fri, Feb 25, 2011 at 11:17 AM, b_t bartata...@gmail.com wrote: What is wrong? Should I check something else? What

[android-developers] Re: FileNotFoundException

2011-02-25 Thread b_t
widgets was just an example, the folder and file is: File folder = new File(Environment.getExternalStorageDirectory(), myAppName + /widgets); if (!folder.exists()) { folder.mkdirs(); } File file = new File(folder, fileName); On febr. 25, 18:47, TreKing treking...@gmail.com wrote: On

[android-developers] Re: FileNotFoundException

2011-02-25 Thread nhasan
Does your application have permission to write to the externel SD card? http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group,

[android-developers] Re: FileNotFoundException on FileOutputStream when writing on sdcard, no idea why

2010-02-11 Thread Jason Proctor
since 1.6, IIRC also, use Environment.getExternalStorageDirectory() instead of hardwiring the /sdcard path, as the location may change in future Yeah thanks guys, I forgot to write the WRITE_EXTERNAL_STORAGE permission, it's all good now. It's weird because it's the first time I ever

[android-developers] Re: FileNotFoundException when creating FileOutputStream with file on sdcard

2008-10-07 Thread UBZack
You're absolutely right, myFile.txt was a directory (who knew!?) So now I'm making one instance of File and calling mkdirs on just / sdcard/zackcorp/myfiles/, and then I'm making a second instance of File, this time with that path AND the file name, and just calling File.createNewFile(), it

[android-developers] Re: FileNotFoundException when creating FileOutputStream with file on sdcard

2008-10-06 Thread Jason Proctor
this is because file.mkdirs() doesn't understand that the second argument you provided to the File constructor is a file name rather than a directory name. i think you might find, and indeed i found, that /sdcard/zackcorp/myfiles/myFile.txt is actually a directory. the directory is writable