Skip to content Skip to sidebar Skip to footer

Android Access Folder Using Environment.getexternalstoragedirectory On Device With Only Internal Memory Would Return?

im using this code to access a folder: String path = Environment.getExternalStorageDirectory().getAbsolutePath()+ '/somefolder'; on devices with sdcard this is ok, i don't have a

Solution 1:

There are a few different types of "internal" storage.

On the first few android devices they had internal storage which was the partition in which the OS, and the installed applications were stored. Modern devices continue to have this type of internal storage (now adays you'll see 1-2gb of this type of storage on the higher end devices). This storage area is inaccessible to the user (unless they are rooted).

The other type of "internal" storage is generally much larger in space, and is accessible by the user. This type of storage is usually found on devices that don't come with an SD card. As of now (june 2012) 8 or 16gb are the most common sizes for this type of storage I think.

So on a device with no SD card your method is going to return to you the path that leads to the second type of "internal" storage. In fact basically what has happened here is they've put that flash memory in the device and basically tricked the OS into seeing it the same way as an SD card, but without the option to unmount / remove.

Post a Comment for "Android Access Folder Using Environment.getexternalstoragedirectory On Device With Only Internal Memory Would Return?"