如何读/ Android上写外部USB存储? [英] How to read/write external USB storage on Android?

查看:299
本文介绍了如何读/ Android上写外部USB存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前做一个应用程序,需要能够读取和写入通过USB OTG适配器连接的USB闪存驱动器。有一个简单的方法来访问通过标准的java.io.File API的这种存储?这个程序是唯一将要在扎根摩托罗拉Xoom运行运行Android 4.2.2。任何建议将是AP preciated。

I am currently making an app that needs to be able to read from and write to a USB flash drive connected via a USB OTG adapter. Is there an easy way to access this storage via standard Java.io.File APIs? This app is only going to be run on a rooted Motorola Xoom running Android 4.2.2. Any suggestions would be appreciated.

推荐答案

USB驱动器得到安装到您的设备就像一个SD卡确实基本上*。

USB Drives get mounted to your device just like an SDCard does essentially*.

在安装路径通常驻留在:

The mount path usually resides at:

/存储/ USB0 /

/storage/usb0/

我没有用过这个在许多设备上其他然后我的Droid运行的CyanogenMod,您的设备可以很。您可以smiply使用文件管理器来探索这条道路。该目录将仍然存在,即使没有安装路径,这样你就能够确定路径。

I have not used this on many devices other then my Droid running CyanogenMod, your device may very. You can smiply use a file manager to explore this path. The directories will still exist even if there is no mount path, so you will be able to determine the path.

这篇关于如何读/ Android上写外部USB存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆