I am writing a small app that reads files that must be regularly written to storage on the device from a source external to the device, be it USB, Bluetooth, Airdroid, etc. From what I've read, nothing like that can write to internal storage. I would like to manage the files in internal storage for access privacy.
My first solution is an activity that lets the user write files to external storage, and then tap a button to transfer them to internal storage. If this doesn't happen in n minutes, the files on external storage are destroyed. But, I a have since found out that getExternalStorageDirectory
is pretty useless, because devices emulate external storage on internal storage, and Android can't know if and how this is done.
Yet I was wondering if there wasn't some sort of built-in activity that lets users upload or download files directly from internal storage, but without free access to the whole file structure of internal storage, like they have with internal storage.
As a last resort, maybe my app can receive the files over a TCP connection and write them to internal storage itself. It's messy, but so is trying to find an SD card. See the question Find an external SD card location.
NEW: The aim of this exercise is to find all .csv files in a directory on the SD card, let the user choose one, process it, and write an output file to the SD card. The user will enter a "Weight" value that will be used in the calculations for processing the file.
But, since Android is so unreliable at providing the location of really external storage, i.e. the SD card, I want to try and store the files in internal storage, where Android seems to be more honest and reliable about the location of that storage.