Android : files in data/media and external storage directory

on Thursday, September 4, 2014


I am copying files from a zip file to /data/media/0/Sample. But, when I checked in the device file explorer, the file is not there. When I check programmatically, the files are captured using listFiles() function but each file returns false when exist() function is called. The files can only appear in the device's file explorer and return true when exist() is called when I enter 'ls -l /data/media/0/Sample' or 'ls -i /data/media/0/Sample' commands via adb shell.


Upon research, I found out that most file explorers check Environment.getExternalStorageDirectory() which is hard linked to data/media path. If these paths are connected via hard link, why is it that the files do not reflect properly on the other directory?


I am using a rooted device for this. Thank you!


0 comments:

Post a Comment