Android 和 iOS 中的应用程序文件大小差异
通过使用两个应用程序分发服务(Android 市场和 Apple 应用程序商店),我发现了一个谜团。
Apple 应用程序的文件大小通常大于 Android 应用程序。 我似乎找不到任何对这些差异的解释,而且这似乎是一个未触及的主题。
我尝试过分配不同的应用程序,差异似乎在几 MB 到 6-8 MB 之间。那么问题来了,为什么苹果应用程序的文件大小会更大呢?额外的 MB 有何用途?
示例:
BBC:
Android:918K - https://market.android.com /details?id=bbc.mobile.news.ww
苹果:6.7 MB - http://itunes.apple.com/dk/app/bbc-news /id364147881?mt=8
由于某些垃圾邮件防护措施,我无法直接链接到其余部分。
英国航空
Android:1.2 MB
Apple:7.9 MB
Northern Bank
Android:2.1 MB
Apple:6.4 MB
Bank of America
Android:727K
Apple:2.1 MB
我可以继续...如果有人可以提供两个应用程序发行版的文件大小统计数据,证实或反驳我的理论。 - 我将不胜感激。
Working with both app distributions services (android market and Apple App store) I have discovered a mystery.
The file size of an app is in general larger for an Apple app than for a Android app.
I can't seem to find any explanation for the differences, and it seems to be an untouched subject.
I have tried allot of different apps and the difference seems to vary between a couple of MB to 6-8 MB. So the question is, how come the file size is larger for Apple apps? What is the extra MB used for?
Examples:
BBC:
Android: 918K - https://market.android.com/details?id=bbc.mobile.news.ww
Apple: 6.7 MB - http://itunes.apple.com/dk/app/bbc-news/id364147881?mt=8
Due to some spam prevention, I'm unable to link directly to the rest.
British Airways
Android: 1.2 MB
Apple: 7.9 MB
Northern Bank
Android: 2.1 MB
Apple: 6.4 MB
Bank of America
Android: 727K
Apple: 2.1 MB
I could go on... If anyone can provide a statistics of file size for the two app distributions, confirming or disproving my theory. - I would appreciate it allot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我刚刚花了最后一天左右的时间试图找出这个确切的问题。我为 Android 构建了一个名为 BlockIT 的小游戏,现在我有一个适用于 iOS 的运行版本。极其奇怪的是,Android 版本为 8.2 MB,iOS 版本为 14.1 MB。
现在,由于我是来源的所有者,我想追踪这一点并找出原因。正如许多人在这里所说的那样,这是图形元素 - 事实并非如此。每个包中的整个数据集(非代码)几乎相同。这是有道理的,因为我在每个应用程序中使用相同的图形。
那么,为什么代码构建有如此大的不同!我的 iOS 代码构建接近 7 MB,Android 代码不到 3 MB。代码本身被编写为以相同的方式运行,并且除了一小部分代码之外的所有代码在每个平台上都完全相同。我发现构建(iOS gcc)设置对您获得的输出大小有很大影响。如果您仅设置为目标 ARM6 或 ARM7,那么我的代码二进制文件的大小将从 7 MB 下降到 5 MB。这表明一个二进制文件中每个目标的函数和库几乎完全重复!此外,内置的调试符号似乎并没有被完全删除。最后,代码的加密也需要花费大量成本。这可能是最令人费解的,因为 Android 以类似的方式签署他们的 apk。 iOS 签名的方式似乎很奇怪。
所以,我希望这会有所帮助。重申一下:
- 图像/数据似乎不是问题
- 在 iOS 上构建的代码会在一个二进制文件中生成多个平台输出 == 很多额外的代码(顺便说一句,我不知道苹果为什么这样做 - 看起来很奇怪)。
- iOS 上的代码加密对于大小不太友好。
没有真正的方法可以解决实际问题(再次,奇怪且令人失望)。
I have just spent the last day or so trying to track this exact problem down. I have built a little game called BlockIT for Android, and now I have a running version for iOS. The extremely odd thing is that the Android version is 8.2 MB and the iOS version is 14.1 MB.
Now, since I am the owner of the source, I wanted to track this down and find out why. As many suggest here that it is the graphical elements - this is not the case. The entire data set (non code) was almost identical in each package. Which makes sense since I am using the same graphics in each application.
So, why is the code build so much different! My iOS code build was nearly 7 MB and the Android one was less than 3 MB. The code itself was written to run identically and all but small portions of code are exactly the same on each platform. What I found was that the build (iOS gcc) settings had massive effects on what size of output you get. If you set only to target ARM6 or ARM7 then the size of my code binary dropped from 7 MB to 5 MB. This indicates there are almost complete duplicates of functions and libraries for each target in the one binary! Additionally, the built-in debugging symbols dont seem to get entirely stripped. Finally, the encryption of the code also costs large amounts. This is probably the most puzzling, since Android signs their apk's in a similar fashion. It seems that the iOS signing is done very oddly.
So, I hope that helps. To reiterate:
- Images / Data don't seem to be the problem
- Code building on iOS generates multiple platform output in the one binary == lots of extra code (btw I dont wee why Apple does this - seems odd).
- Code encryption is not very size friendly on iOS.
There's no real way to fix the actual problem (again, odd and disappointing).
iOS 应用程序中的二进制可执行文件是加密的,因此压缩效果非常差或根本不压缩。 iOS 应用程序中的二进制可执行文件是使用一些静态链接的库代码进行编译的,这通常会使其比类似内容的解释型 Dalvik 字节代码更大。 iPhone 应用程序往往包含更多高质量图形内容和艺术品,适用于多种屏幕分辨率,包括相对较大的 iPad 显示屏。
The binary executable in an iOS app is encrypted, and thus compresses very poorly or not at all. The binary executable in an iOS app is compiled with some library code statically linked, which can often make it larger than interpreted Dalvik byte code for similar stuff. iPhone apps tend to contain more high quality graphics content and artwork for multiple screen resolutions including the relatively large iPad display.
对于 iPhone 中的通用应用程序,我们需要放置三种尺寸的图像 -
一种尺寸为 320x480 像素
第二个为 640x940 像素(视网膜)
第三个用于 768x1024 (iPad)
,在开发 Android 应用程序时,我们需要放置三种图像 -
hdpi(高)
mdpi(中)
ldpi(低)
Android 中还有一件事,没有强制规则放置所有三种图像。基本上这取决于您制作应用程序的目标,仅对于我们需要放置图像的分辨率。
For a universal app in iPhone we need to put three size of images -
one for 320x480 px
second for 640x940 px (retina)
third for 768x1024 (iPad)
where as while developing a android application we need to put three kind of images -
hdpi (high)
mdpi (medium)
ldpi (low)
one more thing here in android there is no compulsory rule to put all three kind of images. Basically it depends on for which target you are making app , only for those resolution we need to put images.
在我看来,Apple 开发人员正在使用更多的全屏尺寸图像(低清晰度和 Retina),并且比 Android 多得多的图像,并且 iPhone 的 UI 定义文件 (.XIB) 比 Android 中使用的 XML 文件大得多。包装中的压缩也应该有差异(.APK)是如此巨大的压缩!最后也许在包括框架方面有所不同,但在这一点上我不知道:)
In my opinion, Apple Developers are using more full-screen size Images (in low def and Retina), and much more images than Android, and UI definitions files for iPhone (.XIB) are much bigger than XML files used in Android. There also should be a difference of Compression in packaging (.APK) is so hugely compressed ! And Finally maybe a difference in Including frameworks, but on this point I have no clue :)