I currently have a working implementation that allows me to list USB devices, request permission for that USB device and then connect to them (mainly from http://developer.android.com/guide/topics/connectivity/usb/host.html). The code I have is the same as the linked article but none of the methods on the classes provided are for listing files on the device or checking if files exist.
However I do not understand how I can list files that are on the USB device to check if files exists before transferring data.
The device "path" is along the lines of /dev/bus/usb/00x
but this can't be accessed directly through File
. I see the app ES File Explorer
is able to list files on a USB (non-rooted device) so I know it is possible. I have also tried accessing URI paths like usb://100x
as it seemed like ES File Explorer was doing that, but I had no luck.
I have tried using the Storage Access Framework. On a Samsung Galaxy Tab it works with both SD Cards and USBs, however on the Google Nexus 10 it does not work with either (it has no SD Card slot) so I'm trying to implement another way to talk to the USB.
Version is Lollipop and above.
Any ideas? Thanks.
emulated
andlegacy
(both pointing to same place). In /mnt there's no folder/file I can see that represents the USB Drive, just other things that are mostly empty. – Ottava