3

I am currently developing an app which will be used on Galaxy Xcover 2 (GT-S7710) devices. This phone has a quiet strange behaviour: it lists two external storages. The first one has capacity of 1 GB, path: /storage/sdcard0 and the second has capacity of 14GB, path /storage/extSdCard. The second one is a real removable SD card, the first storage is located on the device, i guess.

If i call Environment.getExternalStorageDirectory(), the path for the first storage is returned. Is there any method two query for the second storage? I could use a fixed absolute path, but that would seem to be a very bad solution, and also would break compatibility for other phones.

WonderCsabo
  • 11,947
  • 13
  • 63
  • 105
  • 1
    I think there is a problem in the documentation https://code.google.com/p/android/issues/detail?id=63084 – amatellanes Dec 06 '13 at 11:32
  • Yeah, you are correct, the doc missing explanation of how to access the secondary external storage. That's why i asked the question. :) – WonderCsabo Dec 06 '13 at 11:39
  • 1
    I found a working solution here: http://stackoverflow.com/a/19982338/747412 – WonderCsabo Dec 08 '13 at 15:47
  • Before you get too happy, you may not be able to WRITE to the ACTUAL SD card: only READ. This is a Samsung quirk. You can get past that restriction by getting root access. Again, you MAY run into that. I expect any Samsung device that is running a Samsung version of Android, 3.2 or later, has external SD card writing disabled. – Steven_BDawg Jun 25 '14 at 19:04
  • Fortunately i could write with the mentioned device, also with an *Evolveo StrongPhone Q4* which has the same behavior regarding external storage. – WonderCsabo Jun 25 '14 at 19:18
  • I now this topic is old but this may help. you should use thi method. System.getenv(); see project Environment3 to access all storage that are connected to your device. https://github.com/omidfaraji/Environment3 – Omid Faraji Mar 22 '16 at 18:40

2 Answers2

0

I think you will find an answer to your question here

Basically the sistem does not give you access to the secondary esternal storage media via Enviorment class to ensure that data related to your app will be deleted when your app is unistaled.

elvisrusu
  • 378
  • 5
  • 18
  • I know that page, and it does not help. The only way is manually parsing mounted devices like it is done in the referenced solution. – WonderCsabo Jun 25 '14 at 19:20
0

I now this topic is old but this may help. you should use thi method.

System.getenv();

see project Environment3 to access all storage that are connected to your device.

https://github.com/omidfaraji/Environment3