In an Android app, I am storing files on a SD card in the device.
Occasionally the user also need to export data to a USB disk that will be attached for the occasion.
I am using Context.getExternalFilesDirs()
to locate the SD card and I am using Environment.isExternalStorageRemovable()
to distinguish the internal storage from the SD card.
My problem is that the USB disk, when attached, show up the exact same way as the SD card. It is included in the list returned by Context.getExternalFilesDirs()
and is also "removable" according to Environment.isExternalStorageRemovable()
and the path does not reveal anything.
Is there a way to distinguish an attached SD card from an attached USB drive?