My application needs to access files on a usb stick from a rooted Nexus7 tablet over an OTG cable. I have been looking into this extensively and found a few related posts but no real answer.
I know this is possible, because I can mount it with stickmount though I can't use third party software, so I need to somehow re-implement this myself.
When I plug in the USB stick it appears as 001 in /dev/bus/usb/001, so I was hoping it would be as simple as:
Runtime.getRuntime().exec("su -c \"mount /dev/bus/usb/001/001 /sdcard/test\"");
but that doesn't work. A little toast pops up with
myApp has been given superuser permissions:
mount /dev/bus/usb/001/001 /sdcard/test
But it isn't mounted.
Am I formatting the command wrong, or is this the completely wrong way to go with it? Any ideas on how I could get this thing to mount?
Thanks