问题
This emerged out of an earlier question Android app on Chromebook to access USB devices?
It seems that ARC does not yet provide any way to access external storage except using { "enableExternalDirectory": true }
. This has some significant limitations for my use case.
The intent is that a user can insert a USB Flash Drive into the device, and for my app to read and write files on it.
Unfortunately, with the enableExternalDirectory
option enabled, the user is forced to select a directory, even if they are not using any of the features for which my app requires such access. The simplest approach is for the user to select the Downloads folder instead of the USB device.
Later, if the user wishes to write data to the Flash Drive, he must use the Directory icon in the top left corner of the ARC App window, and then restart.
I plan to include the required instructions in-app, but for better experience, I'd like to be able to track whether they have done this.
How can I
- Pop open the prompt for the user to choose a directory
- Detect which directory was selected. (external or internal)
- Restart my app so the new mounted directory will take effect?
Are any of these possible in an ARC app?
来源:https://stackoverflow.com/questions/39710118/how-can-my-android-app-see-the-mounted-directory-when-running-on-chromebook-with