优化小.COD(的.jar)文件 [英] Optimizing for a smaller .cod (.jar) file

查看:147
本文介绍了优化小.COD(的.jar)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RIM的编译器执行的结果的.jar,而构建最终.cod文件额外的优化和COM pression,但有些事情可以由开发商来完成,以减少显著最终.cod文件大小。

The RIM compiler performs extra optimization and compression on the resulting ".jar" while building the final .cod file, but there are things that can be done by the developer to significantly reduce the final .cod file size.

一个这样的事情是将运行 PNGCrush ,的使用OptiPNG ,或类似的工具来降低包括.png文件的大小。在具有大量的图像文件的应用程序(如应用程序具有自定义UI),这可以产生在最后的.cod文件大小显著减少。

One such thing would be to run PNGCrush, OptiPNG, or a similar tool to reduce the size of the included .png files. In an application with a large number of image files (such as an app featuring a custom UI), this can yield a significant reduction in the final .cod file size.

你有优化的大小最终.cod文件任何提示?东西在的.java code本身做什么?一些在项目结构来完成?事情做对文件或资源?

Do you have any tips for optimizing the final .cod file for size? Something to be done in the .java code itself? Something to be done in the project structure? Something to be done to the files or resources?

谢谢!

推荐答案

好问题!


  • 的COM pression(的GZip ,的的ZLib )可能是有用的安装大型斌/ TXT / XML文件时,

  • Compression (GZip, ZLib) may be useful when installing large bin/txt/xml files

这就是他们在RIM说什么:

And that's what they say in RIM:

  • Setting appropriate access
  • Avoid creating interfaces
  • Use static inner classes
  • Avoid unnecessary field initialization
  • Import individual classes

此外,<一个href=\"http://supportforums.blackberry.com/rim/board/message?board.id=java%5Fdev&message.id=49861\"相对=nofollow>有趣的事实的:

所有图像是PNG格式。我想
  知道为什么:与JDE 4.5编译 - >
  900K,编译JDE 4.2,2.6.1,4.7 - >
  1800K。有什么区别?谢谢!

  


All images was PNG format. I want to know why : compile with JDE 4.5 --> 900k, compile JDE 4.2, 2.6.1, 4.7 --> 1800k. What is difference ? Thanks !


似乎JDE 4.5使用了更多的优化技术比旧JDE
  版本。
  


Seems that JDE 4.5 uses more optimization techniques than older JDE versions.


检查下面的图片,它由 PNGOUT 从55ķpng图片制作。它的大小为3427字节

Check the image below, it produced by PngOut from 55 K png image. It's size is 3427 bytes

这篇关于优化小.COD(的.jar)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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