为什么我在设备上的应用大小与 APK 或 Play 商店的大小不同 [英] Why does my app size on device differ than the APK or Play store size

查看:81
本文介绍了为什么我在设备上的应用大小与 APK 或 Play 商店的大小不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户提出的非常有效的问题,我无法深入了解为什么 Google Play 商店上报告的大小与设备上报告的大小不同.我在 PC 上签名的发行版 APK 大小为 3.8MB.上传到 Google Play 会显示类似的大小.但是,查看设备上的应用管理器会显示以下统计信息:

I have a quite valid question from a user which I'm unable to get to the bottom of trying to understand why the size reported on Google Play store is different than the size reported on the device. My signed release APK size on my PC comes in at 3.8MB. Uploading to Google Play shows a similiar size. Looking at the app manager on the device however shows the following stats:

Total: 6.62MB
App:   6.51MB
Data:   112KB

这与 Google Play 启用的复制保护无关(正如其他类似问题所暗示的那样),因为我在安装已签名的 APK 或开发 APK 时获得了相同的统计数据.

This is not to do with Google Play enabled copy protection (as other similar questions sugget) as I get the same stats installing the signed APK or development APK.

手机上/data/app 下的 APK 又是 3.8MB,而/data/data/com.my.app 下的文件又变成了 100KB 左右(大概是上面的数据"行).

The APK on the phone under /data/app is again 3.8MB and the files under /data/data/com.my.app come to another 100KB or so (presumably the 'Data' row above).

导致统计数据差异的原因是什么?

What is causing the discrepancy in stats?

进一步研究这一点,这是我设备上许多应用程序的通用功能.Google Play 报告一种尺寸,而设备报告的尺寸通常是其 2 倍.很高兴知道这可能不是我正在做的事情,但仍然很好奇这里的推理是什么,因为被用户指责篡改"安装大小以使其看起来更小令人沮丧!

Researching this further, this is a common feature across many applications on my devices. Google Play reports one size and the device reports something generally in the magnitude 2 times greater. So good to know its probably not something I'm doing, but still curious what the reasoning here is as its frustrating to be accused by users of 'doctoring' the install size to appear smaller!

推荐答案

android系统安装APK时,安装的是DEX文件.其中包含编译为二进制文件的代码、资源等.您的 dex 通常与您的 apk 大小相同,除非您的资源未编译在资产中.

When installing an APK in android system, what's installed is the DEX file. Which contains your code, resources etc compiled as binaries. Your dex is generally the same size of your apk, unless you have resources not compiled in assets.

嗯,我们都知道.没有广泛传播的是 android 也会保存您的原始 apk.也许是为了在出现错误或其他原因时重新安装.

Well, we all know that. What's not widelly spread is that android SAVES your original apk too. Perhaps for reinstalling in case of errors or for some other reasons.

这就是为什么我们的应用程序的内存量是系统中的两倍.它是原始apk和安装的dex的大小之和.

That's why the amount of memory of our apps is the double in system. It's the sum of the size of the original apk and the installed dex.

这篇关于为什么我在设备上的应用大小与 APK 或 Play 商店的大小不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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