J2MEOverviewWhat is J2ME?ConfigurationsSlide 5Slide 6ProfilesCLDC ProfilesCDC ProfilesCLDC ConfigurationCDC ConfigurationOther small Javas (all based on Java 1.1)The CLDCCLDC specificationsCLDC class loadingCLDC securityCLDC sandboxMIDP and MIDletsMIDP requirementsMIDP java platformMIDletsMIDlet suiteMIDlet suite securityMIDlet executionJ2ME25 July 2002OverviewWhat is J2ME?The CLDC and CDC configurationsMIDP and MIDletsDevelopment ToolsDemonstrationsWhat is J2ME?Java implementation for devices that cannot support full Java 1.3 (J2SE)Ironic: Java was initially developed for use in portable,embedded systemsExamples: PDA’s, mobile phones, very small servers (Tini), webpadsThe family also includes J2EE for serversConfigurations A configuration defines a class of devices in hardware terms: type and speed of processor, memory size, type of network connectionConsists of a virtual machine specification for the configuration and a set of java classes that the configuration supportsConfigurations Two configurations currently defined CLDC = low-end consumer electronics device, 512K RAM, e.g. mobile phone (currently also PDA’s)CDC = device with circa 2MB RAM (high end PDA’s, set-top boxes, 3G phones)Configurations Particular virtual machine is NOT part of the spec, but the reference designs tend to get usedFor CLDC, the Kilobyte (KVM) virtual machine implements the configurationCVM implements CDC specification for Linux and Wind River VxWorksOther VM’s exist, eg. IBM J9 for CLDCProfilesA profile consists of a set of classes that extend a configuration to add particular functionalityThere are profiles to extend CLDC, different profiles to extend CDCProfile can depend on another profile for functionality, as well as on the configurationCLDC ProfilesMIDP = mobile information device profile: display and storage for mobile phones, network connection based on http v1.1. Code for MIDP devices called “MIDlets”PDAP = better screen and more memory (not implemented)CDC ProfilesFoundation Profile = includes almost all core java 2 v1.3 classes. Personal Basis Profile = basic user interface profile (written?)Personal Profile = adds multi-window user interface functionality to personal basis profile (written?)RMI profile, Game profileCLDC ConfigurationCLDCMIDP PDAPCDC ConfigurationCDCRMIgamefoundationfoundationpersonalPersonal basisOther small Javas(all based on Java 1.1)JavaCard (smartcard, e.g. GSM SIM card, French phone card, 16K RAM)EmbeddedJava -- allows class-by-class definition of device capabilitiesPersonalJava -- v1.1.8, devices such as iPaq, Nokia 92xx communicator, full feature JVMThe CLDCAssumes 128KB of flash or battery backed persistent storage32KB volatile storageAssumes no display or input deviceAssumes only that the OS can run the VM (e.g. KVM). Could be PalmOS, BREW, NOS,…CLDC specificationsNo floating point (NB there is no separate J2ME compiler)No reflectionNo finalizationLimited multithreadingLimited error reportingNo JNICLDC class loading Class loading mechanism provided by the implementation and cannot be extended by application codeMust support compressed .jar filesCan convert to whatever internal format is needed (e.g. .prc)CLDC securityCLDC devices range from those on which no new code can be loaded at all by user to those in which code can be downloaded from untrusted sourcesNot enough computational power for J2SE security model Application code runs in a “sandbox”CLDC sandboxApplication code cannot create its own class loadersApplication cannot substitute its own classes for core java or javax.microedition classesNo JNI, hence no native code except that installed with the VMPreverification of class files on host before download, used to assist bytecode verification at runtimeMIDP and MIDletsCLDC by itself is more limited than most handheld devicesMIDP extends CLDC to include a simple UIRuns on KVM PDAP intended for PDA’s, but currently MIDP being used for them (e.g. Palms)MIDP requirements128KB RAM (vs. 32KB for CLDC)Additional 32KB for Java heap8KB nonvolatile storage96x54 pixel displayInput device that can enter 0-9, arrow keys, selectSupport http 1.1 “in some way”MIDP java platformCLDC packages plus stuff in javax.microedition and timer in java.utilMIDlet more restricted than applicationMIDlet cannot halt the VMMIDlet does not enter at main()Device must set microedition.locale propertyMust also set microedition.profiles propertyMIDletsMust contain at least one class derived from javax.microedition.midlet.MIDletA number of methods must be implemented by the MIDlet so it will run in the sandboxMust use only API’s from the MIDP specification for portabilityMIDlet suiteSet of MIDlets installed/removed as a group that can access device resources in shared mannerAll MIDlets in a suite run on same VM, share same instances of classes and resources (share data)Usual java primitives for synchronizationMIDlet suite securityMIDlets in a suite can access persistent storage in a shared fashion -- no access across suites to persistent storage (security and namespace issues) No authentication (SecurityManager) as in J2SESome protections against malicious MIDlets in the limited APIMIDlet executionMust have default public constructor3 states: paused, active, destroyedUpon loading, constructor runs, and then MIDlet is pausedUpon becoming active, runs method startApp() May later pause, then become active again, later be destroyed, etc. (pauseApp, destroyApp
View Full Document