I have a backup restore app on Google Play. Currently, it allows backing up things on the storage returned by Environment.getExternalStorageDirectory().
But, I want to let the users choose a backup directory, whether it be on SD card, internal storage or USB drive. Then, I want to save its path in shared preferences and save backups in it whenever user creates a new backup.
How do I get a list of all storages and ask a one time permission to write to them whenever I want?