Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

02 cldc


Published on


Published in: Technology
  • Be the first to comment

  • Be the first to like this

02 cldc

  1. 1. CLDCConnected, Limited Device Configuration Cornelius Koo - 2005
  2. 2. CLDC Devices Characteristics• 160 - 512 kb total memory available for java platform• 16 bit / 32 bit processor• low power consumption, often battery powered• intermitten network connectivity (often wireless), limited bandwith
  3. 3. Hardware Requirements• CLDC doesnt have specific hardware requirements• Minimal memory requirements :• 128 kb - for running the JVM and CLDC libraries. This memory must preserve its content, even when the device is powered off. (Nonvolatile memory)• 32 kb - available during application runtime for allocation of objects. (Volatile memory / heap)
  4. 4. Software Requirements• The Operating System must be able to running JVM and managing Java applications on the device including : Select and launch application Remove application
  5. 5. JVM Specification for CLDC
  6. 6. Java Language for CLDC• CLDC doesn’t support floating point type. (double and float)• CLDC doesn’t support finalize() method.• CLDC only support limited set of Exception classes for error handling.
  7. 7. Java Virtual Machine for CLDC• JVM doesn’t support floating point operation.• JVM doesn’t support native interface and native method invocation.• Reflection is not available.• JVM must implement the classloader.• finalize() method is not available.• JVM doesn’t suport ThreadGroup class.• JVM doesn’t support weak references.
  8. 8. Weak References• Garbage collector recognizes that an object is being referenced, yet the object is still a candidate for garbage collection.
  9. 9. Security Handling• Any devices running Java application will need protection from malicious codes that may access system information or resources.• This “Low Level” protection is implemented through class file verification.
  10. 10. CLDC Class File Verification• Class file verification is done in 2 steps in CLDC.• 1st Step is pre-verification.• 2nd Step is in-device verification.
  11. 11. Pre-Verification• Pre-verification :• A software program is run to insert additional attributes into the class file.• Class file will be approximately 5% larger after pre-verification.• Done as part of development process or before a class file is loaded on a device.• A "Stack Maps" is added to the class file, describing what variables and operands are art of the interpreter stack space.
  12. 12. In-Device Verification• In-Device verification :• Once a device loads a pre-verified class file, the in-device verifier runs through each instruction.• There are several checks done to validate the code.• At any point the verifier can report and reject the class file.• Code verifier program for KVM is in the range of 10kb and less than 100 bytes of heap space required.
  13. 13. CLDC Package
  14. 14. Java Classes
  15. 15. System Classes• java.lang.Class• java.lang.Object• java.lang.Runnable• java.lang.Runtime• java.lang.String• java.lang.StringBuffer• java.lang.System• java.lang.Thread• java.lang.Throwable
  16. 16. Data Type Classes• java.lang.Boolean• java.lang.Byte• java.lang.Character• java.lang.Integer• java.lang.Long• java.lang.Short
  17. 17. Collection Classes• java.util.Enumeration• java.util.Hashtable• java.util.Stack• java.util.Vector
  18. 18. I/O Classes•••••••••••••
  19. 19. Calendar and Time Classes• java,util.Calendar• java.util.Date• java.util.TimeZone
  20. 20. Utility Classes• java.util.Math• java.util.Random
  21. 21. Exception Classes•••••• java.lang.ArithmeticException• java.lang.ArrayIndexOutOfBoundsException• java.lang.ArrayStoreException• java.lang.ClassCastException• java.lang.ClassNotFoundException• java.lang.Exception• java.lang.IllegalAccessException• java.lang.IllegalArgumentException
  22. 22. Exception Classes• java.lang.IllegalMonitorStateException• java.lang.IllegalThreadStateException• java.lang.IndexOutOfBoundsException• java.lang.InstantiationException• java.lang.InterruptedException• java.lang.NegativeArraySizeException• java.lang.NullPointerException• java.lang.NumberFormatException• java.lang.RuntimeException• java.lang.SecurityException• java.lang.StringIndexOutOfBoundsException• java.util.EmptyStackException• java.util.NoSuchElementException
  23. 23. Error Classes• java.lang.Error• java.lang.OutOfMemoryError• java.lang.VirtualMachineError
  24. 24. Internationalization••• both can be used to convert from bytes to/from unicode.
  25. 25. Reference• Core J2ME Technology and MIDP. John W. Muchow. Prentice Hall PTR, 2002.• Enterprise J2ME: Developing Mobile Java Applications. Michael Juntao Yuan. Prentice Hall PTR, 2003.• J2ME in A Nutshell. Kim Topley. Oreilly, 2002.• Wireless J2ME Platform Programming. Vartan Piroumian. Prentice Hall, 2002.