[英]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.