Optimizing for a smaller .cod (.jar) file

落花浮王杯 提交于 2019-12-05 13:28:38

Good question!

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

And that's what they say in RIM:

Also, interesting facts:

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 !


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


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

I think you most certainly want to consider a shrinker (and optimizer/obfusticator) like ProGuard (http://sourceforge.net/projects/proguard/). This can shrink your Java code by collapsing full class names into shortened versions, removing unused code, etc. Along the way it can improve the efficiency of the code. It's great. The only hard part is modifying your build to optimize the generated class files before the RIM build stuff gets its hands on it to make a .cod.

A good approach is to GZIP all resources and then use net.rim.device.api.compress.GZIPInputStream class to load compressed files. That way you don't have to implement decompress code by yourself.

Also you can use pngout for optimizing image resources.

Make sure that you use PNG-8 instead of PNG-24 when possible. Try to minimize number of colors in palette. After this, use PngOut.

As for ProGuard, I have problems on old BB devices when using optimize feachure of Progruard ("-dontoptimize" switch) - so use it carefully, although it is a great tool.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!