Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2007

    How to bundle a huge data file with jad/jar distribution?


    I have a J2ME app and need to bundle a 25MB file with it.

    If I throw it into the application jar I will probably get an OutOfMemory exception on cheaper phones.
    Is it possible to bundle it into sort of a super-jar (app and data)
    or can I trigger the automatical installation of the data file in the jad?

    Thank you

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK

    Re: How to bundle a huge data file with jad/jar distribution?

    Is it one data file? Or many, smaller files?

    Yes, you can make a JAR that's 25Mb. However, some devices will not install it, as they impose JAR size limits (all Series 40s, for example).

    You may have problems downloading a file this size OTA (over the air). You may hit network limitations. Also, consider download cost and time (25Mb will take around half an hour at EDGE speeds).

    I ask if it's one file, because some devices will want to load the entire file into the Java heap as soon as you open it. Devices with less than 25Mb of heap might have a problem opening it. I would not be surprised if you find that no phone can actually open the file. You might need to split it into smaller parts.

    You cannot trigger any kind of "automatic download" as part of the installation process. An installtion consists of a JAD and a JAR, and that's all.

    You could try downloading the data by HTTP in the application itself. You will have two problems here:

    1. Again, without 25Mb of heap, you won't be able to download it in a single HTTP transaction. You will need to split it into separate files, and transfer each part with a separate HTTP request.

    2. You will need to store it somewhere. Many devices will impose a limit on the amount of space allowed for RMS (including Series 40 devices). If you want to support those devices, you'll need to store it somewhere else. You can try the file system, but access there comes with security warnings.

    You mention "cheaper phones"... it's worth pointing out that some cheaper phones don't even have 25Mb of storage space.

    I think the first question might be: what devices do you want to support?


Similar Threads

  1. Replies: 0
    Last Post: 2006-06-05, 18:08
  2. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56
  3. Replies: 1
    Last Post: 2005-05-26, 14:22
  4. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

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