0

Is there a way using ADB to know the location of what a specific plugged in device will return for Environment.getExternalStorageDirectory ?

I would like to push a file there and then read this file from the activity running on the device. I think this path can vary based on device, and I will have to run this on numerous different android devices.

Thanks!

jhnclvr
  • 9,137
  • 5
  • 50
  • 55

2 Answers2

0

is 'adb shell "echo $EXTERNAL_STORAGE"' what you have been looking for?

Alex P.
  • 30,437
  • 17
  • 118
  • 169
0

For now you could probably get away with just using "/sdcard" in case you don't find a better solution. It's defined pretty static in the Android source.

mibollma
  • 14,959
  • 6
  • 52
  • 69
  • I guess based on the answer to this question: http://stackoverflow.com/questions/3591494/writing-to-internal-sd-card-on-android I am worried the manufacturer may have changed it. Is that super unlikely? – jhnclvr Jul 01 '11 at 19:56
  • It may happen but i don't see a reason for them to change it as long as they use only one sdcard. Since the path is buried in the Android source and not in some config file i would say its unlikely. – mibollma Jul 01 '11 at 20:01
  • tried a few diff devices Samsung/LG/Huwaie) and this seemed to work ;) – jhnclvr Jul 05 '11 at 15:06