×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    How to compress Jar File for J2ME

    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

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: How to compress Jar File for J2ME

    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.

  3. #3
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: How to compress Jar File for J2ME

    Thanks for reply....
    thanks & Regards.
    Nilesh

  4. #4
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Re: How to compress Jar File for J2ME

    Also, keep in mind to remove the thumbs.db from the project folder, which is created as per the Windows properties. Either turn the property off in the Windows or delete from the Netbeans project explorer.

    Quote Originally Posted by nyerunkar View Post
    Thanks for reply....

  5. #5
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: How to compress Jar File for J2ME

    thnx for reply..i'll try..this
    thanks & Regards.
    Nilesh

  6. #6
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: How to compress Jar File for J2ME

    In addition to all the above suggestions, you can also try obfuscation

    Hartti

  7. #7
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: How to compress Jar File for J2ME

    i tried but stilll... i want more compression.............
    thanks & Regards.
    Nilesh

  8. #8
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: How to compress Jar File for J2ME

    Have you tried everything what petrib suggested?

    Hartti

  9. #9
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: How to compress Jar File for J2ME

    Sorry i dont know what is it .........?
    thanks & Regards.
    Nilesh

  10. #10
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: How to compress Jar File for J2ME

    Petrib has lots of good suggestions in the first answer to your question in this same thread. Have you tried all those?

    Hartti

  11. #11
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: How to compress Jar File for J2ME

    yes,,but i cant remove external lib..from my project ....
    thanks & Regards.
    Nilesh

  12. #12
    Registered User
    Join Date
    Dec 2008
    Location
    Cochin, Kerala, India
    Posts
    84

    Re: How to compress Jar File for J2ME

    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.

  13. #13
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: How to compress Jar File for J2ME

    Quote Originally Posted by vinuk4u View Post
    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.
    Which is, pretty much, what I already said in reply #2 nine days ago.

  14. #14
    Nokia Developer Moderator
    Join Date
    Dec 2011
    Posts
    174

    Re: How to compress Jar File for J2ME

    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

  15. #15
    Registered User
    Join Date
    Dec 2011
    Posts
    11

    Re: How to compress Jar File for J2ME

    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)?

Similar Threads

  1. How to compress image in j2me
    By rajan701v in forum Mobile Java General
    Replies: 1
    Last Post: 2011-05-14, 13:54
  2. how to compress a file to zip
    By wangfsun in forum Symbian
    Replies: 4
    Last Post: 2010-05-25, 07:08
  3. how to compress audio file?
    By aamitgupta in forum Symbian
    Replies: 9
    Last Post: 2009-12-24, 02:20
  4. compress the JAR file
    By crajesh_2985 in forum Mobile Java Tools & SDKs
    Replies: 8
    Last Post: 2009-10-11, 15:57
  5. How To compress SIS file?
    By kusumat in forum Symbian
    Replies: 11
    Last Post: 2009-10-05, 09:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •