Android Things filesystem

一笑奈何 提交于 2019-12-06 09:55:39

I'm didn't try it, but seems it's possible by the same way as in normal Android OS. To do this You should mount Your USB dongle into the filesystem somewhere e.g. in new folder /mnt/usb like in this answer of Onik or that project of Keval Patel:

Mount USB drive:

Plug you USB drive at any of the USB port in your Raspberry Pi.

Open adb shell by typing below command in terminal (Make sure your raspberry pi is connected via adb):

adb shell

Mount the USB drive by running below command in adb shell (Your USB drive should be formatted in FAT file system):

su mkdir /mnt/usb

mount -t vfat -o rw /dev/block/sda1 /mnt/usb

where

sda1 is the first partition of the first disk (sdb1 is the first partition of the second disk, etc.) and /mnt/usb - new folder for mounted USB dongle.

Then You can access to mounted USB dongle something like this way:

File usbDongleRoot = new File("/mnt/usb");

(or something like this).

Also take a look at this answer of JBA and that repo of Shaka Huang.

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