简体   繁体   English

Android getExternalFilesDir vs getFilesDir()用于大文件

[英]Android getExternalFilesDir vs getFilesDir() for big files

The difference between getExternalFilesDir and getFilesDir() is clear to me and well explained here . getExternalFilesDir和getFilesDir()之间的区别对我来说很清楚,并在此处进行了详细解释。

In my case, since I need to keep files private and not accessible by user or other Apps (at least in non rooted device), getFilesDir() seems to be perfect. 在我的情况下,因为我需要将文件保密并且用户或其他应用程序无法访问(至少在非root设备中),getFilesDir()似乎是完美的。 However I'm going to place big files there (let's say around 2Gb in total) and I would like to know if that folder/partition is typically capable enough for that purpose (I haven't found anything about that in the documentation). 但是我要在那里放置大文件(让我们说总共约2Gb)我想知道该文件夹/分区是否通常足够用于此目的(我在文档中没有找到任何相关内容)。

Edit: 编辑:

I've found some information here . 我在这里找到了一些信息。 It seems that modern devices sould have at least 1GB, but I still can't figure out what is the typical partition size on modern devices... 现代设备似乎至少有1GB,但我仍然无法弄清楚现代设备上的典型分区大小......

Even having 20GB in data partition (not the same that internal storage that you show in the default file explorer) one app that waste 2GB is about 10% it have to be very important for me to keep it i use more of 10 apps . 即使有20GB的数据分区(与你在默认文件浏览器中显示的内部存储不一样),一个浪费2GB的应用程序大约是10%,对我来说非常重要的是保持它使用10个应用程序。 and many telephones dont have 20GB. 许多电话没有20GB。

To have 2GB in the internal storage of the device is to much for one app , many devices have 2GB or 4GB in Data partition, some have less and the point with apps is made to run in all devices as posible. 设备的内部存储容量为2GB,对于一个应用程序来说很多,许多设备在数据分区中有2GB或4GB,有些设备较少,而且应用程序的点在所有设备中都可以运行。

The data partition is used for the system apps to store data to if is full the system gets slow and malfunction. 数据分区用于系统应用程序存储数据,如果已满,则系统变慢并出现故障。 If the external storage is full is not the same. 如果外部存储器已满,则不一样。

If you want probide some security like "the data of this app can't be stealed unless you root the phone" You can store youre data in the external storage encripted, and save the key in the internal, to prevent other aplications to steal the data. 如果你想要一些安全措施,比如“这个应用程序的数据不能被窃取,除非你手机根”你可以将数据存储在外部存储器中,并将密钥保存在内部,以防止其他应用程序窃取数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 getFilesDir() vs getExternalFilesDir(),哪个更值得推荐? - getFilesDir() vs getExternalFilesDir(), which one is more recommended? 从URI或原始文件路径重新创建文件时文件长度为0 [getExternalFilesDir(String type)vs getFilesDir()] - File length is 0 when recreating file from URI, or original filepath [getExternalFilesDir(String type) vs getFilesDir()] Android getFilesDir()vs getDir()-如何在我的应用程序私有数据中保存文件? - Android getFilesDir() vs getDir() - What do I use to save files in my apps private data? getExternalFilesDir 替代 android 2.1 - getExternalFilesDir alternative in android 2.1 Android使用getExternalFilesDir保存图片不一致 - Android inconsistent picture saving with getExternalFilesDir Android-getFilesDir()。lstFiles()返回null吗? - Android - getFilesDir().lstFiles() returning null? 无法在 Android Studio 中找到 getExternalFilesDir() 函数的上下文 - Unable to find Context for getExternalFilesDir() function in Android Studio Android说无法解析方法'getExternalFilesDir(null)' - Android says cannot resolve method 'getExternalFilesDir(null)' 卸载应用程序时,不会删除内部存储“getFilesDir()”中的文件 - Files in internal storage "getFilesDir()" are not being deleted when app is uninstalled Android 10 创建文件夹 - getExternalFilesDir 代替 getExternalStorageDirectory()(不推荐) - Android 10 create a folder - getExternalFilesDir instead getExternalStorageDirectory() (deprecated)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM