是否有记录的方式,在安卓2.X,检查多张SD卡的内容? [英] Is there a documented way, in Android 2.x, to inspect multiple sd cards for content?

查看:126
本文介绍了是否有记录的方式,在安卓2.X,检查多张SD卡的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些安卓2.x的平板电脑,如HTC Flyer的与三星Galaxy Tab支持内部平板电脑的存储和外部SD卡。例如在我的传单, / SD卡 / sdcard2 是分开的,前者重presenting平板电脑的内部存储。

Some Android 2.x tablets such as the HTC Flyer and Samsung Galaxy Tab support both internal tablet storage and an external SD card. For example on my Flyer, /sdcard and /sdcard2 are separate, with the former representing the tablet's "internal storage."

如果我用 Environment.getExternalStorageDirectory(),似乎没有要上的其中任何一组规则的那些存储位置将是返回。在使用 getExternalStorageDirectory(),我担心的是,我只觉得媒体存储在两个存储位置之一。

If I use Environment.getExternalStorageDirectory(), there doesn't seem to be any set rule on which of those storage locations will be returned. In using getExternalStorageDirectory(), my concern is that I'll only find media stored on one of the two storage locations.

一个解决方法就是硬code扫描 / SD卡* 到应用程序,但是这使得一个假设,即所有设备都将使用它作为一个命名方案,我不认为这是一个安全的假设。

One solution is to just hard-code scanning /sdcard* into the application, but this makes an assumption that all devices will use that as a naming scheme, and I don't consider that a safe assumption.

是否有成文的方式进行扫描,并在Android 2.x中使用多个SD卡/存储位置?

Is there a documented way to scan and use multiple sd card/storage locations on Android 2.x?

我的目标其实就是寻找在平板电脑上所有的有声读物,所以我想找到并使用所有 / SD卡*在某些文档的方式/有声读物

My goal is actually to find all audiobooks on the tablet, so I'd like to find and use all /sdcard*/Audiobooks in some documented way.

推荐答案

通常第二个SD卡安装在第一位。

Normally second sdcard is mounted within the first one.

下面是我的意思是:

  • 首先SD卡安装在到/ mnt / SD卡

第二个SD卡安装到到/ mnt / SD卡/ external_sd

所以每当你收到到/ mnt / SD卡的路径外部存储,并开始扫描树,你不会错过第二个SD卡(如果它也安装)

So whenever you receive /mnt/sdcard as path for external storage and start scanning the tree, you won't miss the second sdcard (if it was also mounted).

这是没有记录的行为。但Galaxy Tab的行为完全这样。我想这是因为没有官方Android API支持(即环保类无特殊功能)的多个外部存储器。

This is not documented behavior. But Galaxy Tab behaves exactly this way. I assume this is because there is no official Android API support (i.e. no special function in Environment class) for multiple external storages.

这篇关于是否有记录的方式,在安卓2.X,检查多张SD卡的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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