Hi,
I am having problem in reducing the jar size, If you have any idea please let me know. it may be Image size reduction or Code size Redution. for that Image iknow Clipping, if u know any new idea pls let me know
Hi,
I am having problem in reducing the jar size, If you have any idea please let me know. it may be Image size reduction or Code size Redution. for that Image iknow Clipping, if u know any new idea pls let me know
If you know that a class variable will not change, make it āstatic finalā.
Use as few methods as possible.
Use as few classes as possible.
Use method instance variables over class instance variables. Note: Jury is still out on this for me. Iāve seen a reduction using this technique, but not sure if it was truly the idea or the obfuscator made the difference.
Use something like ProGuard to further obfuscate and reduce your code.
Other? I am relatively new to J2ME development, too, so I am still learning the tricks of the trade as I go along.
Hereās another article that talks about optimization a little more ā¦
http://www-106.ibm.com/developerworks/wireless/library/wi-pvcperf/
It might be a good idea to give us some more information.
Tell us how many classes and images you have. What kind the images areā¦ how you organized emā¦ wich formatā¦ how big the palette is.
Also tell us how big that files are and how small it should be etc.
Finally a rule of thumb hintā¦ use an obfuscator or even twoā¦ for example the Jax + Jarg combo was quite nice for the 4k game contest. Also 7zip compresses damn well (use āultraā). Oh and if you use png images crunch em as much as possible with pngout (by Ken Silverman - thatās the guy who made the Build engine used by Duke Nukem 3D btw ;)).
On older KVM implementations, the over head for every class and interface is something like .5K
Unfortunately given the incredible limits those same had sets have on MIDLET size (as little as 64K) the best answer I can give for those environments is to abandon much of your OOP.
Donāt use interfaces at all. Limit yourself to the absolute smallest number of classes you can get away with without making your code totally impossible to maintain. Obfuscate to reduce namespace. Those are the biggies.
If you have a lot of images you may want to look at how you are encoding them and do things like reduce the bit-depth, depending on your targetās capabilitiesā¦