The document discusses Java technologies for embedded systems programming, including J2ME (Java 2 Micro Edition) and JavaCard. J2ME provides a smaller virtual machine called KVM that requires only 64KB of memory compared to the standard JVM's 512KB requirement. J2ME also allows for configuring the runtime environment by removing unnecessary classes. JavaCard further reduces code size to 8KB by running complex applications on remote servers while the card stores encrypted user data and communicates with the server.
The document discusses Java technologies for embedded systems programming, including J2ME (Java 2 Micro Edition) and JavaCard. J2ME provides a smaller virtual machine called KVM that requires only 64KB of memory compared to the standard JVM's 512KB requirement. J2ME also allows for configuring the runtime environment by removing unnecessary classes. JavaCard further reduces code size to 8KB by running complex applications on remote servers while the card stores encrypted user data and communicates with the server.
The document discusses Java technologies for embedded systems programming, including J2ME (Java 2 Micro Edition) and JavaCard. J2ME provides a smaller virtual machine called KVM that requires only 64KB of memory compared to the standard JVM's 512KB requirement. J2ME also allows for configuring the runtime environment by removing unnecessary classes. JavaCard further reduces code size to 8KB by running complex applications on remote servers while the card stores encrypted user data and communicates with the server.
The document discusses Java technologies for embedded systems programming, including J2ME (Java 2 Micro Edition) and JavaCard. J2ME provides a smaller virtual machine called KVM that requires only 64KB of memory compared to the standard JVM's 512KB requirement. J2ME also allows for configuring the runtime environment by removing unnecessary classes. JavaCard further reduces code size to 8KB by running complex applications on remote servers while the card stores encrypted user data and communicates with the server.
Publs.: McGraw-Hill Education 1 PROGRAMMING CONCEPTS AND EMBEDDED PROGRAMMING IN C, C++ and JAVA: Lesson-12: J2ME and JavaCard 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 2 Large J VM in J ava J ava byte codes that are generated need a larger memory when a method has more than 3 or 4 local variables. An embedded J ava system may need a minimum of 512 kB ROM and 512 kB RAM because of the need to first install J VM and then run the application. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 3 Use of J 2ME (J ava 2 Micro Edition) or J ava Card or EmbeddedJ ava helps in reducing the code size to 8 kB for the usual applications like smart card J 2ME (J ava 2 Micro Edition) J 2ME (J ava 2 Micro Edition) and and J avaCard J avaCard has small size virtual machine has small size virtual machine 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 4 J 2ME J 2ME J ava 2 Micro Edition Provides Configurations and profiles for the small devices 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 5 J 2ME new virtual machine, KVM (Kilobytes J 2ME new virtual machine, KVM (Kilobytes Virtual Machine) Virtual Machine) KVM as an alternative to J VM. When using the KVM, the system needs a 64 kB instead of 512 kB run time environment. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 6 KVM features KVM features Use of the following data types is optional. (i) Multidimensional arrays, (ii) long 64-bit integer and (iii) floating points. Errors are handled by the program classes, which inherit only a few needed error handling classes from the java I/O package for the Exceptions. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 7 KVM features KVM features Use of a separate set of APIs (application program interfaces) instead of J INI. J INI is portable. But in the embedded system, the ROM has the application already ported and the user does not change it. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 8 KVM features KVM features There is no verification of the classes. KVM presumes the classes as already validated. There is no object finalization. The garbage collector does not have to do time consuming changes in the object for finalization The class loader is not available to the user program. The KVM provides the loader 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 9 KVM features KVM features Thread groups are not available. There is no use of java.lang.reflection. Thus, there are no interfaces that do the object serialization, debugging and profiling 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 10 J 2ME features J 2ME features Use core classes only. Classes for basic run time environment form the VM internal format and only the programmer's new J ava classes are not in internal format Provide for configuring the run time environment. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 11 Configurability Configurability Examples of configuring are deleting the exception handling classes, user defined class loaders, file classes, AWT classes, synchronized threads, thread groups, multidimensional arrays, and long and floating data types. Other configuring examples are adding the specific classes for connections when needed, data-grams, input output and streams 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 12 Create one object at a time when running the multiple threads. J 2ME 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 13 J 2ME provides the optimised run-time environment. Instead of the use of packages, J 2ME provides for the codes for the core classes only. These codes are stored at the ROM of the embedded system. J 2ME 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 14 Reuse the objects instead of using a larger number of objects. Use scalar types only as long as feasible J 2ME programming using small code size programming using small code size 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 15 Provides for configuring the run time environment. Examples of configuring are deleting the exception handling classes, user defined class loaders, file classes, AWT classes, synchronized threads, thread groups, multidimensional arrays, and long and floating data types. J 2ME 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 16 J 2ME provides Scaleable OS feature J 2ME need not be restricted to configure the J VM to limit the classes. Configuration augmentation by Profiler classes. For example, MIDP (Mobile Information Device Profiler). A profile defines the support of J ava to a device family. J 2ME J 2ME 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 17 Mobile information device profile (MIDP) Mobile information device profile (MIDP) MIDP used as in PDAs, mobile phones and pagers. A touch screen or keypad. A minimum of 96 x 54 pixel color or monochrome display. Wireless networking. A minimum of 32 kB RAM, 8 kB EEPROM or flash for data and 128 kB ROM. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 18 MIDP MIDP MIDP classes describe the displaying text. Profile Classes for the network connectivity. For example, for HTTP. [Internet Hyper Text Transfer Protocol.] Provides support for small databases stored in EEPROM or flash memory. Schedules the applications and supports the timers. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 19 J 2ME Two alternative configurations J 2ME Two alternative configurations Connected Device Configuration (CDC) and Connected Limited Device Configurations (CLDC). CDC inherits a few classes from packages for net, security, io, reflect, security.cert, text, text.resources, util, jar and zip. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 20 CLDC does not provide for the applets, awt, beans, math, net, rmi, security and sql and text packages in java.lang. There is a separate javax.microedition.io package in CLDC configuration. A PDA (personal digital assistant) uses CDC or CLDC. J 2ME Two alternative configurations J 2ME Two alternative configurations 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 21 J ava Card or J ava Card or EmbeddedJ ava EmbeddedJ ava Use of or J ava Card or EmbeddedJ avahelps in reducing the code size to 8 kB for the usual applications like smart card. How? The following are the methods. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 22 Reducing up to the code size to 8 kB possible for the usual applications like smart card. J avaCard J avaCard 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 23 J avaCard J avaCard The J ava advantage of platform independence in byte codes is an asset The smart card connects to a remote server. The card stores the user account past balance and user details for the remote server information in an encrypted format. It deciphers and communicates to the server the user needs after identifying and certifying the user. 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 24 J avaCard J avaCard The intensive codes for the complex application run at the server. A restricted run time environment exists in Java classes for connections, data-grams, character-input output and streams, security and cryptography only 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 25 Summary Summary 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 26 We learnt J 2ME provides benefits of small J VM optimized run-time environment configurations and profiles in J 2ME for small devices Configuration augmentation extensive class libraries for network and web applications modularity, robustness 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 27 We learnt J 2ME provides secure restricted permissions portability platform independence for programming small devices such as mobile and card 2008 Chapter-5L12: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 28 End of Lesson 12 of Chapter 5 End of Lesson 12 of Chapter 5