Android如何计算缓存和数据大小?
应用程序属性中缓存和数据的大小是如何计算的?
我将所有数据保存到 SD 卡上,但 Android 显示我经常使用 4 KB,但 SD 卡上大约有 50 KB。与缓存相同!我在那里放了一张 3MB 的图片。但我的缓存大小为零!
我认为我使用的是正确的目录:/mnt/sdcard/Android/data/my.package.name/files
和 /mnt/sdcard/Android/data/my.package。名称/缓存
。
Android 4.0.x 中这是否有所改变?
请参阅此屏幕截图:
How is the size of cache and data calculated in the application properties?
I save all my data to the SD card, but Android shows me that I'm constantly using 4 KB, but on the SD card are about 50 KB. The same with the cache! I put a 3 MB picture in there. But my cache size is zero!
I think I'm using the correct directory: /mnt/sdcard/Android/data/my.package.name/files
and /mnt/sdcard/Android/data/my.package.name/cache
.
Has this changed in Android 4.0.x?
See this screenshot:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信缓存大小是 http://developer.android.com/reference/android/content/Context.html#getCacheDir()
我认为您已经使用过:
http://developer.android.com/reference/android/content /Context.html#getExternalCacheDir()
I believe the Cache size is the size of the Internal Cache directory that is returned by http://developer.android.com/reference/android/content/Context.html#getCacheDir()
I think you've used:
http://developer.android.com/reference/android/content/Context.html#getExternalCacheDir()
应用程序属性页面仅显示内部存储器的使用情况,不显示外部存储器(SD 卡)的使用情况。
我不知道他们为什么选择这样做,但一个原因是 SD 卡的管理程度不同:虽然你可以让 Android 为你的应用程序管理 SD 卡数据,但你也可以绕过它并使用自定义文件夹结构。
此外,外部存储器通常远大于内部存储器,并且可以由用户管理,因此SD卡的使用可能并不是那么重要。
The application properties page only shows usage for the internal memory, not for the external memory (SD card).
I don't know exactly why they chose to do it like this, but one reason would be that the SD card is not managed to the same degree: while you can get Android to manage SD card data for your application, you can also bypass it and use a custom folder structure.
Additionally, external memory is usually far larger than the internal memory, and can be managed by the user, so SD card usage is probably not all that important anyway.