×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Media-rich JAR too large?

    I am currently developing a Java application that makes use of quite a lot of small graphics and sounds. Unfortunately, because of this, the size of my JAR exceeds the 2MB limit. I have already followed some of the steps to reduce the size of my images with this link. I have also been using the obfuscator, which has helped too. The problem that I have is that the bulk of the JAR is being taken up by my sound files. The sound files themselves are already at the lowest possible settings I can have them at without compromising the quality and I've already tried experimenting between some of the different formats MP3 and WAV with little difference to the JAR size.

    Has anyone got any ideas on how to get around this issue?

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: Media-rich JAR too large?

    Download the "excess" files from the network at run-time and adapt your code to work, if it is not possible for some reason or another.

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Media-rich JAR too large?

    How low do you go with MP3s? Playing out of a phone speaker, as little at 9.6kbps might be acceptable.

    Do you have lots of small files, or a small number of big files? Small files are expensive, because of the per-file overhead.

    If images have a large number of colour shades, reduce the bit-depth of the colour channels - many paint apps have a "posterize" feature for this (GIMP does, for example). I just tested this on a 55k PNG, setting the posterize option in GIMP down from 256 to 128, and re-saved as a 42k PNG, without any obvious difference. See how far you can drop the colour resolution before the difference is intolerable.

    Graham.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: Media-rich JAR too large?

    Indeed, an texture/atlas map (single file, from which you clip smaller parts for your needs) is more efficient (in terms of memory/storage) than individual/separate bitmaps: http://en.wikipedia.org/wiki/Texture_atlas

  5. #5
    Registered User
    Join Date
    Mar 2013
    Location
    United Kingdom
    Posts
    161

    Re: Media-rich JAR too large?

    Thanks for the help, never considered lazy loading the sounds when my application started, that would work alright, but would add bit of complexity to my app and require a net connection (not ideal for the app I am making).

    I'll have a look at your suggestion about reducing the image sizes, although I am afraid the sound files are already at the lowest bit rate and in single channel mode so no further compression is possible.

    Thanks!

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Media-rich JAR too large?


  7. #7
    Regular Contributor
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    262

    Re: Media-rich JAR too large?

    Then develop the app in the particular platform native format.Java might be cross platform but in term of performance,it is very limited or you can develop in qt/qml that support symbian,blackberry,android(still alpha),ios(still alpha),desktop and harmattan.Qt/qml is more mature in desktop,harmattan and symbian.

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Media-rich JAR too large?

    Quote Originally Posted by babylongreece View Post
    Then develop the app in the particular platform native format.Java might be cross platform but in term of performance,it is very limited or you can develop in qt/qml that support symbian,blackberry,android(still alpha),ios(still alpha),desktop and harmattan.Qt/qml is more mature in desktop,harmattan and symbian.
    Since Grift mentions the 2 MB size limit, I tend to assume he is actually developing for Series 40 devices. Which native format do you suggest then?

  9. #9
    Regular Contributor
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    262

    Re: Media-rich JAR too large?

    Quote Originally Posted by wizard_hu_ View Post
    Since Grift mentions the 2 MB size limit, I tend to assume he is actually developing for Series 40 devices. Which native format do you suggest then?
    My first nokia phone is s40 also but when come to developing,i never even consider s40 platform so maybe someone can tell what is native format for s40.I am noob

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Media-rich JAR too large?

    "Development Frameworks" is listed as the first item of "General" when you open a device specification from https://www.developer.nokia.com/Devi...pecifications/

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Media-rich JAR too large?

    For the deferred loading topic: according to the theory you can have 2000 pieces of 512-kilobytes stores (RMS). I get these numbers from #9 and #11 of http://www.developer.nokia.com/Commu...f-rms-database, I hope they are true.
    The resulting capacity limit is near to a gigabyte.
    Drawbacks I see, without experience:
    - while image/texture data can be stored this way without any problems, there may or may not be a mysterious bug in the loading side, http://www.developer.nokia.com/Commu...does-not-works reports a problem with LWUIT's createImage from byte array (the problem is not validated though)
    - working with audio data is probably a bit cumbersome, as you have to chunk the data into max. half-megabyte pieces, then you have to find a way to play them back (there is no streaming API as far as I know), and in addition the entire thing will occupy space from your own heap.

  12. #12
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Media-rich JAR too large?

    Note also that from Nokia Asha software platform, the JAR size limit increases to 5Mb.

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Media-rich JAR too large?

    Hehe, it (https://www.developer.nokia.com/Devi...ions/Asha_501/) has been edited . I do remember that originally JAR+Heap was 4+4. Now it is 3+5, where 3 is "Recommended" (?).

  14. #14
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Media-rich JAR too large?

    Quote Originally Posted by wizard_hu_ View Post
    Hehe, it (https://www.developer.nokia.com/Devi...ions/Asha_501/) has been edited . I do remember that originally JAR+Heap was 4+4. Now it is 3+5, where 3 is "Recommended" (?).
    Curse.

    Well, 3 is better than two!

  15. #15
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    284

    Re: Media-rich JAR too large?

    Back to the question of reducing the sound file size.

    1) sound format AAC may be an alternative. You can see on the the device page "Multimedia-> Audio Formats" what sound formats the device supports.
    If the sound is mostly speech, you can get a lot better then mp3.

    2) You should see a big difference between mp3 and wav. If not, there may some uneeded things in your jar fie. You can open the jar file (for example with 7-zip) and examine the contents to see that there is nothing left that should not belong there, like backup files, thumbnail files, experimental sound files, etc.
    You can also see what parts takes the most space.

    Regards

    Karsten Meier

Similar Threads

  1. How to accommodate large large text data in CAknListQueryDialog?
    By slinx in forum Symbian User Interface
    Replies: 1
    Last Post: 2012-01-25, 05:18
  2. Play large media files
    By Eagle King in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2011-05-11, 03:39
  3. Rich Media Content
    By HasithaRandika in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2009-04-03, 13:10
  4. Rich media Format help
    By anshumandada in forum Streaming and Video
    Replies: 1
    Last Post: 2008-03-20, 12:25
  5. Rich Media Format help
    By anshumandada in forum General Development Questions
    Replies: 1
    Last Post: 2008-03-20, 02:30

Posting Permissions

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