[android-developers] Re: getExternalFilesDir may not be the SD card!

2011-12-13 Thread niko20
Yes, it is another stupid thing we have to deal with. This one though
I don't think is Google's fault, it's the device manufacturers that
decided to remap this. The only way around it is to allow users to
browse to the external sdcard in some way. I actually had to add a
menu item to my app to allow users to type in the path to the external
sd since if they transferred their sdcard to a new device, and that
device now had *internal* sd as well, then my app would not even see
the external card because the API was giving me the internal one.

So I added a menu item where they can type in the *real* path to the
external sdcard.

It's like writing for windows !



-niko


On Dec 13, 7:46 am, RLScott fixthatpi...@yahoo.com wrote:
 I need to write to the SD card so the user can transfer data files
 created by my app to other devices.  getExternalFilesDir() does not
 always point to the SD card, even when there is one.  As the developer
 docs say:

 Quote:

 Note: don't be confused by the word external here. This directory
 can better be thought as media/shared storage. It is a filesystem that
 can hold a relatively large amount of data and that is shared across
 all applications (does not enforce permissions). Traditionally this is
 an SD card, but it may also be implemented as built-in storage in a
 device that is distinct from the protected internal storage and can be
 mounted as a filesystem on a computer.  In devices with multiple
 external storage directories (such as both secure app storage and
 mountable shared storage), this directory represents the primary
 external storage that the user will interact with.

  and indeed my testing confirms this.  On 2 out of 3 Android
 tablets I have for testing, getExternalFilesDir() directs me to built-
 in memory, not the removable SD card.  And this posting on
 Stackoverflow indicates that there is no general solution for this
 problem:

 http://stackoverflow.com/questions/5524105/how-could-i-get-the-correc...

 How can this be?  Is it truly impossible to write a generic Android
 app that for sure will access the SD card?

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


[android-developers] Re: getExternalFilesDir may not be the SD card!

2011-12-13 Thread RLScott
And that's doable by starting with what?
Environment.getRootDirectory() ?

On Dec 13, 9:10 am, niko20 nikolatesl...@yahoo.com wrote:
 Yes, it is another stupid thing we have to deal with. This one though
 I don't think is Google's fault, it's the device manufacturers that
 decided to remap this. The only way around it is to allow users to
 browse to the external sdcard in some way. I actually had to add a
 menu item to my app to allow users to type in the path to the external
 sd since if they transferred their sdcard to a new device, and that
 device now had *internal* sd as well, then my app would not even see
 the external card because the API was giving me the internal one.

 So I added a menu item where they can type in the *real* path to the
 external sdcard.

 It's like writing for windows !

 -niko

 On Dec 13, 7:46 am, RLScott fixthatpi...@yahoo.com wrote:







  I need to write to the SD card so the user can transfer data files
  created by my app to other devices.  getExternalFilesDir() does not
  always point to the SD card, even when there is one.  As the developer
  docs say:

  Quote:

  Note: don't be confused by the word external here. This directory
  can better be thought as media/shared storage. It is a filesystem that
  can hold a relatively large amount of data and that is shared across
  all applications (does not enforce permissions). Traditionally this is
  an SD card, but it may also be implemented as built-in storage in a
  device that is distinct from the protected internal storage and can be
  mounted as a filesystem on a computer.  In devices with multiple
  external storage directories (such as both secure app storage and
  mountable shared storage), this directory represents the primary
  external storage that the user will interact with.

   and indeed my testing confirms this.  On 2 out of 3 Android
  tablets I have for testing, getExternalFilesDir() directs me to built-
  in memory, not the removable SD card.  And this posting on
  Stackoverflow indicates that there is no general solution for this
  problem:

 http://stackoverflow.com/questions/5524105/how-could-i-get-the-correc...

  How can this be?  Is it truly impossible to write a generic Android
  app that for sure will access the SD card?

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