Skip to content Skip to sidebar Skip to footer

Creating A Folder Programmatically On A Xoom

The Xoom does not have a working SD slot, so Moto decided to re-route calls to External Storage to the internal storage: String path = Environment.getExternalStorageDirectory().get

Solution 1:

on my xoom it´s working like this:

    private File path;
    path = new File(Environment.getExternalStorageDirectory().toString() + "/audio");
    path.mkdirs();

mkdirs (with ending s), because then missing dirs on the way to the end-path are automatically created.

are you sure you´re having this in your AndroidManifest?

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Solution 2:

I was having same problem in my Nexus S running android 2.3.4, after playing around with stk's code I was able to create a folder.

Here is the final code:

Fileroot=newFile(Environment.getExternalStorageDirectory().toString()+"//MyFolder");
root.mkdirs();

Simply replaced "/audio" with "//audio" in stk's code and it worked for me.

You should have write permission in your AndroidManifest under tag.

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Post a Comment for "Creating A Folder Programmatically On A Xoom"