使用environment.getexternalstoragedirectory设备上,只有内部存储器将返回Android的访问文件夹? [英] android access folder using environment.getexternalstoragedirectory on device with only internal memory would return?

查看:650
本文介绍了使用environment.getexternalstoragedirectory设备上,只有内部存储器将返回Android的访问文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用这个code访问文件夹IM:

im using this code to access a folder:

String path = Environment.getExternalStorageDirectory().getAbsolutePath()+ "/somefolder";

与SD卡的设备,这是好的,我没有,只有内部存储器测试会发生什么设备,如果在设备上没有SD卡执行会发生什么?它会自动设置到内部存储器路径?
该应用程序的用户将放在此文件夹中的可用内存的根源。

on devices with sdcard this is ok, i don't have a device with only internal memory to test what happens, what would happen if this is executed on a device without sdcard? will it automatically set to the internal memory path? the user of the app would put this folder in the root of the available memory.

有没有办法让内部路径?

is there a way to get internal path?

有没有办法来检查这两个根源,看看这个文件夹是present?

is there a way to check both roots to see if this folder is present?

推荐答案

有几种不同类型的内部存储。

There are a few different types of "internal" storage.

在最初的几个Android设备他们有内部存储这是在操作系统和安装的应用程序被存放的分区。现代设备继续有这种类型的内部存储(现adays你会看到这种类型的存储的1-2GB的高端设备)。这个存储区域是用户无法访问(除非它们根植)。

On the first few android devices they had internal storage which was the partition in which the OS, and the installed applications were stored. Modern devices continue to have this type of internal storage (now adays you'll see 1-2gb of this type of storage on the higher end devices). This storage area is inaccessible to the user (unless they are rooted).

其他类型的内部存储器通常是在空间大得多,并且是由用户可访问的。这种类型的存储通常是对不配备SD卡的设备中。截至目前(2012年6月)8或16GB的是这种类型的存储我认为最常见的尺寸。

The other type of "internal" storage is generally much larger in space, and is accessible by the user. This type of storage is usually found on devices that don't come with an SD card. As of now (june 2012) 8 or 16gb are the most common sizes for this type of storage I think.

因此​​,与您的方法是要回报给你,导致第二种类型的内部存储路径上没有SD卡的设备上。其实基本上就是在这里发生的事情是,他们已经把这些闪存设备中,基本上欺骗操作系统到看到它的方式为SD卡相同,但没有卸载选项/删除。

So on a device with no SD card your method is going to return to you the path that leads to the second type of "internal" storage. In fact basically what has happened here is they've put that flash memory in the device and basically tricked the OS into seeing it the same way as an SD card, but without the option to unmount / remove.

这篇关于使用environment.getexternalstoragedirectory设备上,只有内部存储器将返回Android的访问文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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