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, s
"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 wrote:
> On Fri, Feb 25, 201
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 wrote:
> On Fri, Feb 25, 2011 at 11:17 AM, b_t wrote:
> > What is wrong? Should I check something else?
>
> What is "file"?
> Check the result of "mkd
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 h
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 had to write this
permission. For all my previous aps, I never bothered about it.
Is it a recent change in the OS?
On Feb 12, 7:43 am, skink wrote:
> On Fe
On Feb 11, 8:57 pm, TreKing wrote:
> On Wed, Feb 10, 2010 at 6:00 PM, gallagth wrote:
> > File file = new File("/sdcard/GPS Test/results/results.txt");
>
> Are you certain this path exists on the SD card?
>
> -----
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 wor
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 in
8 matches
Mail list logo