How can my Android App see the mounted directory when running on Chromebook with ARC { “enableExternalDirectory”: true }

青春壹個敷衍的年華 提交于 2019-12-12 03:11:29

问题


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

  1. Pop open the prompt for the user to choose a directory
  2. Detect which directory was selected. (external or internal)
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!