How to read from the INTERNAL STORAGE (subfolder DOWNLOAD) of Android? (>Android 4.0)



After intensive search I could not find out how to read a configuration file (xml) from the internal storage (subfolder download). I tried to access /mnt/sdcard/Download/config.xml but received an Exception.


When trying to get the available folders from the two possible suppliers ApplicationContext and Environment, I get these informations:



context.getFilesDir().getAbsolutePath()
/data/data/com.unicope.oneunified/files

context.getDir("Download", 0).getAbsolutePath()
/data/data/com.unicope.oneunified/app_Download

context.getDir("Download", 1).getAbsolutePath()
/data/data/com.unicope.oneunified/app_Download

Environment.getExternalStorageDirectory().getAbsolutePath()
/storage/emulated/0

context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()
/storage/emulated/0/Android/data/com.unicope.oneunified/files/Download

Environment.getDataDirectory().getPath()
/data


When I try these information to access the config.xml in the Download-folder (I manually copied the file over the Windows explorer) I receive errors, e.g. FileNotFoundException or IllegalArgumentException.


Where is my file, and how can I access it properly?


No comments:

Post a Comment