钛金手机安装包体积过大
我用钛手机制作了一个非常简单的游戏。我只使用了 90k 的声音文件,但使用了相当多的图形,因此我的 .apk
文件约为 2.5MB。我猜大部分来自图形文件。我有几个具体问题。
未使用的图形文件的大小是否会添加到最终包中? (我猜是的,因为编译器无法执行动态 JavaScript 来确定是否需要文件)
Resources/iphone 文件夹中图形文件的大小是否会影响 android 包的大小(反之亦然)
包平均比单独使用本机代码大吗?如果是,增加了多少?
我还能做些什么来减小包裹尺寸?
在 Android 手机上哪种压缩图像的方法最成功?
人们认为多大的文件大小是正常的? (我什么时候应该停止尝试优化?)
那么基本上,我如何测量和减小组件和最终可交付包的大小?
I have made a very simple game in titanium mobile. I only use 90k of sound files, but use quite a lot of graphics, so my .apk
file is about 2.5MB. I am guessing most of this comes from the graphics files. I have a couple of specific questions.
Does the size of graphics files that are not used get added to final package?
(I am guessing yes, because compiler can not execute dynamic javascript to figure out if file could ever be needed)Does the size of graphics files in the Resources/iphone folder affect the size of the android package (and visa versa)
Are the packages bigger on average than using native code alone? If so, by how much?
What else can I do to reduce the package size?
What method of compressing images is most successful on android phone?
What size for a file do people consider normal? (when should I stop trying to optimise?)
So basically, how do I measure and reduce the size of the components and final deliverable package?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回答问题 1、2、4 和6:
1) 是 - 未使用的图形将添加到最终包中。
2) 否 - 不包括资源/iphone 图形。
您可以通过查看
build/android/bin/assets/Resources
来查看中间体(pre-apk),以了解正在编译到二进制文件中的内容。4) 您可以尝试缩小 JS 文件。
6) IMO 2.5MB 相当小
To answer questions 1, 2, 4 & 6:
1) Yes - unused graphics are added to the final package.
2) No - the Resources/iphone graphics are not included.
You can see the intermediate (pre-apk) by looking at
build/android/bin/assets/Resources
to see what is being compiled into your binary.4) You could try minifying the JS files.
6) IMO 2.5MB is pretty small
我试图回答几个问题:
我认为是这样,因为应该根据设备的屏幕分辨率加载匹配的启动屏幕。所以你需要库存不同分辨率的图像。
包应该是zipalign。检查您的 apk 使用情况
zipalign -c -v existing.apk
2.5mb 并不像我想象的那么大。许多应用程序都大于 10 mb.. 因此,没有人会对您的应用程序大小感到困惑。
尝试查看 Android 文档。
i tried to answer a few questions:
i think so since the matching splashscreen should be loaded depending on the screen resolution of the device. so you need to have an image in different resolutions in stock.
packages should be zipalign. to check your apk use
zipalign -c -v existing.apk
2.5mb is not as big as i might think. many apps are >10 mb.. so no one will be confused about your app size.
try a look in the android doc.
您可以删除未使用的库。
阿米阿比
*armeabi-v7a*
x86
现在您可以创建 3 个部署,这三个部署均位于上面指定的平台上。
You can remove unused libraries.
armeabi
*armeabi-v7a*
x86
now you can create 3 deployments this three above named plattforms.