简体   繁体   中英

Android app on Chromebook to access USB devices?

I am taking an Android app and making it run on Chrome using the ARC Welder . For best results we're only targeting the Chromebook / Chrome OS, not Windows or OSX.

The app is running with some minor glitches, but I need to enumerate photos on an inserted SD card.

The problem is that the /mnt folder accessible within Android Runtime only contains the virual sdcard folder, and does not reflect the real SD Card or USB Flash Drives attached to the Chromebook.

How can these photos be automatically loaded from the SD Card into the Android App in the Android Runtime.

I know that I could use a CRX (Chrome Extension) to read the SD Card photos, but how could they be passed to the Android app? And can this be in the same CRX as the ARC Welder creates or must it be a separate CRX?

I found a workaround which is to use the Additional Metadata section and add
{ "enableExternalDirectory": true } .

When the app first launches, it prompts the user for the folder. One must select the SD card.

Then my app works as expected, as the 'emulated sd card' becomes the 'real sd card'. This is not the most user-friendly approach, but it works.

I'd still prefer if we could load the files from a CRX into the Android Runtime...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM