Android Question USB ExternalStorage Question from dummy

almontgreen

Active Member
Licensed User
Longtime User
I'm trying to understand how to use the ExternalStorage class to simply see if there is USB storage connected or not and if connected to specify the USB drive path to use for retrieving known files all done programatically. If the USB drive is connected, I know where to get the files to load images and so forth. I just need to specify the USB drive instead of the internal drive.

Sorry I am so stupid, but I can't figure out how to do this simple thing as the example assumes the user pics files from a list and not access them within the program...
 

DonManfred

Expert
Licensed User
Longtime User
The user is asked to select the rootfolder of the external drive in the example.

If he then selects another folder or any Subfolder of external storage; you are out of luck.

You only have access to the path the user selected plus all subfolder and files from this path.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can try this example

DirRootExternal = /storage/emulated/0
mount point = /storage/
Device = 4AFA-61CB:/storage/4AFA-61CB is removable
Device 4AFA-61CB is a candidate for being the External USB-Drive
probably ExtSDCard: /storage/4AFA-61CB
Device = emulated:/storage/emulated is NOT removable
Device = enc_emulated:/storage/enc_emulated is NOT removable
Device = self:/storage/self is NOT removable
You can find some inspiration in the code used in the example. in this case you can give the user a suggestion which Path he has to choose.
The Device 4AFA-61CB in my case.
 

Attachments

  • StorageV1.0.zip
    5 KB · Views: 194
  • EnvironmentEx2.zip
    7.3 KB · Views: 190
Upvote 0
Top