Hey friend ,,
i developed app for J2ME platform .,, using netbeans 6.9
now my jar file size is 1MB
i use zxing & LWUIT 1.5 Lib ....
please suggest me how i can compress this Jar file,
Hey friend ,,
i developed app for J2ME platform .,, using netbeans 6.9
now my jar file size is 1MB
i use zxing & LWUIT 1.5 Lib ....
please suggest me how i can compress this Jar file,
thanks & Regards.
Nilesh
Check where most of the size comes from, and start from there.
If you have big audio clips, use a more compressed audio format, shorten the clips, etc.
If you use lots of images, use vector formats instead of bitmaps, use smaller bitmaps, reduce the number of colours, etc.
Then you can eliminate libraries (if you use a big library, but only use a fraction of its functionality, consider getting rid of it, and writing your own code with only functionality you need).
After that, you can start reducing features (code) from your own logic.
Last edited by petrib; 2011-12-05 at 07:21.
Thanks for reply....
thanks & Regards.
Nilesh
thnx for reply..i'll try..this
thanks & Regards.
Nilesh
In addition to all the above suggestions, you can also try obfuscation
Hartti
i tried but stilll... i want more compression.............
thanks & Regards.
Nilesh
Have you tried everything what petrib suggested?
Hartti
Sorry i dont know what is it .........?
thanks & Regards.
Nilesh
Petrib has lots of good suggestions in the first answer to your question in this same thread. Have you tried all those?
Hartti
yes,,but i cant remove external lib..from my project ....
thanks & Regards.
Nilesh
Hey Nilesh, while using the obfuscation using Netbeans IDE, you'll find an option in that, compress JAR file, till will try to compress the JAR to an extend, sometimes a major change may happen, and sometimes not. If all these fails, then reduce the size of the resource files, while maintaining the quality required for a smartphone. If that all did, then start from scratch and found out where this file size issue is happening....
Also, too much packages or too much code in the class files or any unwanted files inside the Project folder will increase the size. ok. Reduce the size of the class files by deleting the unwanted & commented codes. These all will reduce some more size.
Hi nyerunkar,
Also a good tool for redusing jar size is to use PNGOUT software on all the PNG files you use in your application. The reduction is about 10% on image files. Please see the link below for instructions.
http://www.developer.nokia.com/Commu...educe_JAR_size
Regards,
tiviinik
Just open your jar file in winzip and see what all things are there. Try following:
See and remove if there are any thumbs.db file (They occupy significant space)
Use highest level of obfuscation.
Use PNGOUT (as suggested by tivi...)
Combine multiple images into one. This saves the space occupied by redundent png headers.
Merge classes / reduce number of classes. (This should be your last refuge)
How are you building your jar? I mean using some IDE or using Antena (ant tool)?