blackberryjava-me.cod-file

Optimizing for a smaller .cod (.jar) file


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.

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.

How can I optimize 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?


Solution

  • Good question!

    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