Search code examples
javamobilejava-mejarmidp

Is there any way to find java memory status on mobile?


I have my J2me application that have 880KB size. I have to run this jar file in multiple phones. Some phones have shown the exceptions given below while clicking jar file.

These are

  1. Java Error. Content Size too Large.
  2. item not supported.

As far as I know, java memory and phone memory are different things. So, we must have sufficient java memory space to run my application.

  1. So, please tell me the reason to this problem and also let me know if there is any way to find Available memory space for JAVA.
  2. How to find if the phone is java enabled or not?
  3. I would like to know whether 880 Kb jar file is normal size or not?

Solution

  • Work on this checklist:

    1. The first error message,
      • As @bharath rightly pointed out 'Java Error. Content Size too Large.' is due to your jar size exceeding the device jar size limit and the reference link.
      • Some useful link for Samsung devices on this topic
    2. The second error message, probably you meant "item not supported cannot be downloaded", is due to incorrect MIME types for .jar and .jad files in the webserver
    3. add these into your webserver's config: 
      
      AddType text/vnd.sun.j2me.app-descriptor jad 
      AddType application/java-archive jar 
      Hopefully that should cover mobile phone related binary package out there
      
    4. Reduce jar size
    5. At this link somewhere in the response posts you can read
      • I recommend limiting the size to 300k (for 2G networks) or 1Mb (for 3G networks), but these are not strict limits., and
      • WAPGateways put a limit of as low as 300k jarsize for OTA downloads thu them