Hi,

In my program, I need to access the full contents of the sdcard for
reading and writing.

I have found that the sdcard is itself mounted at /system/media/sdcard
(on Pandigital Novel 9" tablet, Android 2.0). Is there any library
function that would return this path correctly for any other Android
version? I tried Environment.getExternalStorageDirectory, but it only
returns /sdcard, and through that path I cannot see any files in the
root of the sdcard, only directories like Music, Images, etc.

Through /system/media/sdcard though I can see the entire card
contents.

/proc/self/mounts shows two different devices mounted at /sdcard and
at /system/media/sdcard.

In other words, I had to hardcode  /system/media/sdcard in my program,
but I would like to aviod such hardcoding, and replace it with some
library call.

My code currently is:

.................

        String imgpath = "/system/media/sdcard/" + imageName;
        File imgfile = new File(imgpath);
context.toastMsg("getExternalStorageDirectory: " +
Environment.getExternalStorageDirectory());
        long fsize = imgfile.length();
        context.toastMsg("image found size: " + fsize);
        InputStream fstr = new FileInputStream(imgfile);

.................

The toast popup shows /sdcard.

Thanks.

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

Reply via email to