Java

From Openmoko

Revision as of 10:25, 16 July 2007 by Glenn (Talk | contribs)

Jump to: navigation, search

Contents

Introduction

There are two main types of Java platforms that can be made available on OpenMoko devices such as the Neo1973.

  • Java Standard Edition (J2SE)
  • Java Micro Edition (J2ME)
  • Hybrid Solutions

Java Standard Edition (J2SE)

This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.

When people talk of Java applications, they're usually referring to software targetted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries into account, rather than just the application itself (this isn't the case in J2ME).

Java Micro Edition (J2ME)

This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.

J2ME applications are usually referred to as MIDlets (Sun's name for these applications).

When talking about games, and mobile phone games in general, people are normally referring to this platform. J2ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).

Memory footprints of MIDlets written for J2ME are typically quoted exclusive of the VM or base libraries - this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.

MIDlet are delivered as two files:

  • a .jad MIDlet metadata descriptor
  • a .jar MIDlet container, containing executable bytecode and any required resources

Hybrid Solutions

Other approaches include mixing and matching J2SE and J2ME in various ways. Standard methods include providing a compatibility layer on top of J2SE to allow it to run J2ME and expanding J2ME to provide more J2SE features.

Implementations

J2SE implementations

  • Cacao is a Java Virtual Machine (JVM) which uses Just-In-Time (JIT) compilation to execute Java methods natively.

J2ME implementations

  • PhoneME is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
    PhoneME Feature
    is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
    PhoneME Advanced
    is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.
  • MIDPath is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.

Status on OpenMoko

Java-pkg is a projects.openmoko.org project whose aim it is to "Get Java going on OpenMoko, and once it's running, maintain it. There are two sub-projects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).

Licensing

VM Licensing

MIDlet Licensing

Links

Google should be your first port of call for most things Java as it would be impossible to give a comprehensive list of all the useful information out there. That being said, below is a selected list of further information resources.

J2SE Links

sun seems to have ported j2se to the Neo1973. They used it to show JavaFX on the JavaOne: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609

see also http://blogs.sun.com/jonathan/entry/when_not_where

J2ME Links

Personal tools

Introduction

There are two main types of Java platforms that can be made available on OpenMoko devices such as the Neo1973.

  • Java Standard Edition (J2SE)
  • Java Micro Edition (J2ME)
  • Hybrid Solutions

Java Standard Edition (J2SE)

This is the incarnation of the desktop version of Sun's Java platform. The majority of its codebase was recently opensourced under the GPL+exception license; the closed bits are quickly being replaced by unencumbered alternatives.

When people talk of Java applications, they're usually referring to software targetted to this platform. Application memory footprints on desktop applications usually include the VM and base libraries into account, rather than just the application itself (this isn't the case in J2ME).

Java Micro Edition (J2ME)

This is the 'lite' edition of the Java platform. Modular and optimised for embedded devices, this platform provides a much more restricted set of language and library features.

J2ME applications are usually referred to as MIDlets (Sun's name for these applications).

When talking about games, and mobile phone games in general, people are normally referring to this platform. J2ME games and applications are expected to function within the strict memory capabilities of the corresponding platform (application descriptors allow the runtime environment to know for which they are intended).

Memory footprints of MIDlets written for J2ME are typically quoted exclusive of the VM or base libraries - this is because they are often delivered to Java-enabled devices over the network. Footprint sizes average 10-64KB, with recent devices supporting up to 1MB MIDlets.

MIDlet are delivered as two files:

  • a .jad MIDlet metadata descriptor
  • a .jar MIDlet container, containing executable bytecode and any required resources

Hybrid Solutions

Other approaches include mixing and matching J2SE and J2ME in various ways. Standard methods include providing a compatibility layer on top of J2SE to allow it to run J2ME and expanding J2ME to provide more J2SE features.

Implementations

J2SE implementations

  • Cacao is a Java Virtual Machine (JVM) which uses Just-In-Time (JIT) compilation to execute Java methods natively.

J2ME implementations

  • PhoneME is basically the code base of Sun's commercial Java ME implementation without those components that Sun can't --or won't-- release to the open source community. It is licensed under GPL2. There are actually two versions of PhoneME:
    PhoneME Feature
    is an implementation of the CLDC (Connected Limited Device Configuration) and MIDP2 (Mobile Information Device Profile) as is common on feature phones (e.g. 'normal', non-smart phones).
    PhoneME Advanced
    is an implementation of the more complex CDC (Connected Device Configuration), designed for more advanced handsets.
  • MIDPath is a Java library which provides a MIDP2 implementation and can be used together with the CLDC version of the Cacao to provide an alternative implementation of CLDC/MIDP.

Status on OpenMoko

Java-pkg is a projects.openmoko.org project whose aim it is to "Get Java going on OpenMoko, and once it's running, maintain it. There are two sub-projects, one for JME and one for JSE. Priority is currently given to JME CDC profile." There is currently a work-in-progress recipe for PhoneME Advanced in their SVN, which doesn't fully build, as well as a working recipe for PhoneME Feature, which only works directly on the Neo1973 framebuffer (e.g. you'll have to stop Xfbdev).

Licensing

VM Licensing

MIDlet Licensing

Links

Google should be your first port of call for most things Java as it would be impossible to give a comprehensive list of all the useful information out there. That being said, below is a selected list of further information resources.

J2SE Links

sun seems to have ported j2se to the Neo1973. They used it to show JavaFX on the JavaOne: http://java.sun.com/javaone/sf/media_shell.jsp?id=193609

see also http://blogs.sun.com/jonathan/entry/when_not_where

J2ME Links