In the challenge I want to ultimately be able to look at the created JSON file on the SD card from my PC. The problem I am getting is that although getExternalStorageState says external storage is indeed available (MEDIA_MOUNTED), getExternalStorageDirectory continually returns “/storage/emulated/0”, which is NOT on my SD card, but is in device storage.
While I can cause the data to be saved and restored to this location, and I can grab it via USB connection how do I go about actually making it go to the external storage which seems to be at /storage/extSdCard?
Also when viewing the device’s files in the DDMS File Explorer where would I find this? In /storage I see an “emulated” folder but cant seem to navigate to /stoarge/emulated/0 which the MyFiles app and the view of the Phone directory via USB from my PC seem to be able to navigate to. I suspect that this has something to do with DDMS not being cognizant of the virtual mount point etc.
Well I found the answer to #2 - /storage/emulated/0 contents are in /mnt/shell/emulated/0 …
And as for #1 apparently this is something that happens on Samsung and various OEM devices - this workaround looks awful - sigidin.blogspot.com/2011/08/che … droid.html
Is there a better way for finding the external SD that works on ALL android devices? From what I am reading it seems there is not since OEMs are all doing it differently and they set the result of getExternalStorageDirectory to be whatever suits them. Even scanning the mount table and config files and parsing them as the above attempt will not guarantee a way that works for all devices going forward. This bites in a BIG way.
I am running on a Samsung Galaxy S4.
I am interested to hear BNR’s take on this absurdity.