The J2ME alphabet soup

By Lamont Adams, Special to ZDNet Asia
Monday, July 01, 2002 12:01 PM

Connected Limited Device Configuration
The CDC requirements would make for an expensive mobile phone, IR scanner, or the like. The CLDC is meant for those lesser, and less expensive, devices that can't meet the requirements of the CDC.

CLDC uses a very stripped-down virtual machine designed to run in a low-memory environment. The reference implementation of that JVM is known as KVM, since its size is measured in kilobytes. CLDC is meant for devices with the following:

  • Minimum of 160 KB total memory, 128 KB of which is needed for KVM and the runtime libraries
  • Minimum 16-bit 25-MHz processor
  • Limited user-interface facilities
  • No (or intermittent) low-bandwidth network connection
  • As you'd expect from the draconian memory limitations, the KVM lacks some features provided by the full JVM, which might require you to change your programming style. Some of the things the KVM trades for such a low memory requirement are floating-point math, reflection, and support for class finalizers. Developers using the CLDC will also have to pre-verify their source code after compilation using a verifier tool supplied with the J2ME development kit.

    You've got a great profile
    If a configuration provides the foundation for an application, a profile provides the framework. Profiles define the full set of API classes that will be available to a J2ME application and are built specifically for a given configuration. Sun has made two reference J2ME profiles available: the Foundation and the Mobile Information Device Profile (MIDP).

    The Foundation profile is intended specifically for the CDC configuration and therefore has the luxury of a virtual machine that's almost identical to the standard virtual machine. This means that developers using the Foundation profile have access to a full implementation of J2SE's feature set.

    The MIDP, along with the low-powered CLDC configuration, provides the Java platform you'll likely use when developing applications for today's mobile devices. MIDP supports a limited subset of the J2SE class library and defines custom user interface and input/output classes for use on a CLDC configuration.

    Write once, run anywhere?
    What about compatibility? Can a J2SE application run on a J2ME platform? The answer depends largely on the configuration and profile in use. J2SE code should run with little or no modification using the CDC along with the Foundation profile. However, as I've discussed here, CLDC and the MIDP profile provide only a very limited set of functionality because of the limited host hardware that's available. So it's therefore unlikely that a J2SE application would run unmodified on this platform unless it restricted itself to the API classes that appear on both platforms (which would severely limit its capabilities). Since the CLDC's requirements correspond to the capabilities of most handheld devices in use today, it's doubtful that any J2SE app will run unmodified on a given mobile device. You'll likely have to modify any app you want to port to J2ME. But don't sweat it. Consider it job security instead.


     Previous 1 2 

    WORTHWHILE?

    0

    0 votes
    Save to my library  Save to My Library  
    Blog

    Talkback 0 comments

    There are currently no comments for this post.

    Use shades of gray to enhance scale in Excel

    Microsoft Office Suite

    Excel's palette is generous, but don't throw buckets of pigment all over your spreadsheets just because you can.


    Read more »


    Ultimate 2012 recovery site: the moon

    Blog thumbnail

    Have you seen the disaster movie "2012"? A friend from Control Risks and I did, and we reluctantly concluded we wouldn't be able to write off the cost of our..... by Nathaniel Forbes

    Read more »

    Tech Jobs Now!


    Tags

    1. antivirus
    2. apple ipod
    3. cnet networks inc.
    4. desktop
    5. e - mail
    6. hard drive
    7. intuit inc.
    8. mcafee inc.
    9. microsoft corp.
    10. microsoft windows
    11. microsoft windows vista
    12. microsoft windows xp
    13. norton co.
    14. pc
    15. performance
    16. security
    17. software
    18. tool
    19. web
    20. web site