androiduser mobile wrote:
>         File directory = new File
> (Environment.getExternalStorageDirectory().getPath()+"/downloads");

Creating paths via concatenation is bad form and prone to error (e.g.,
duplicate slashes). Use:

new File(Environment.getExternalStorageDirectory(), "downloads");

>         File file = new File(directory.getPath()+"/"+filename);

See above.

>         if (!file.exists() && directory.exists()){
>               try {
>                   file.createNewFile();
>               } catch (IOException e) {
>                       Log.d(TAG,"File creation failed for " + file);
>               }
>         }

Is the SD card on the target device formatted FAT32, or something else?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.0 In Print!

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