Android Question SDCard issues with Android 4.4.2

sgt

Member
Licensed User
Longtime User
Hi

I have a photo app that writes files either to the sdcard or the phone internal storage. The app writes the files to the DCIM/Camera directory on each storage location. I was using a function getSDCardPath to return a string of the sdcard path that works over all the devices I have tried. I was then using this string path with File.Copy(sdpath, oldfilename, sdpath, newfilename) however this is failing on Android 4.4.2 with 'libcore.io.ErrnoException: open failed: EACCES (Permission denied)' error. But it works on the internal storage and earlier versions of the OS,

I have the following permission's in the Manifest File

AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission (android.permission.READ_EXTERNAL_STORAGE)

But are still getting the error, any help would be appreciated.
 

sgt

Member
Licensed User
Longtime User
Thanks Erel. What I have read the reason for this is change is when someone uninstalls your app android can clean all your files. As these are photos I wouldn't want them to be deleted by removing my app. Is there no way around this?
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

while the external SD card problem is still living on my Galaxy Tab with 3.2 there should be a solution with 4.4.x
I found this on http://source.android.com/devices/tech/storage/
Multiple external storage devices

Starting in Android 4.4, multiple external storage devices are surfaced to developers through Context.getExternalFilesDirs(), Context.getExternalCacheDirs(), and Context.getObbDirs().

does this means there is now a API to get the root of the real external SD-card ?
 
Upvote 0
Top