Scmad Chapter02

1,348 views

Published on

SCMAD - Chapter 02 (Only for studies purposes)

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,348
On SlideShare
0
From Embeds
0
Number of Embeds
44
Actions
Shares
0
Downloads
67
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Scmad Chapter02

    1. 1. By Marcel Caraciolo http://mobideia.blogspot.com Chapter 02 – Configurations and first application SCMAD Certification 45mm 61mm
    2. 2. Agenda <ul><li>Tools and requirements for JavaME development </li></ul><ul><li>First JavaME application – Hello World MIDlet </li></ul><ul><li>Configurations and profiles - differences </li></ul>
    3. 3. Tools and installation <ul><li>Install the Java Development Kit (JDK 1.4 or higher) </li></ul><ul><ul><li>http://java.sun.com/javase/downloads/index.jsp </li></ul></ul><ul><li>Install the Wireless Toolkit (version used here: 2.5) </li></ul><ul><ul><li>http://java.sun.com/products/sjwtoolkit/ </li></ul></ul><ul><li>Install the Eclipse IDE </li></ul><ul><ul><li>Install the pluggin for Eclipse: EclipseME </li></ul></ul><ul><ul><ul><li>http://eclipseme.org/ </li></ul></ul></ul>
    4. 4. First JavaME Application <ul><li>Create a new J2ME MIDletSuite </li></ul><ul><ul><li>Don’t forget to add the WTK emulator path to the EclipseME </li></ul></ul><ul><ul><li>Plug-in (Window -> Preferences -> J2ME -> Device Management) </li></ul></ul><ul><li>Create a new HelloWorld J2ME MIDlet </li></ul><ul><ul><li>Download : http://www.dsc.upe.br/~mpc/HelloWorldMIDlet.java </li></ul></ul><ul><li>Run the Hello World MIDlet </li></ul><ul><ul><li>Eclipse : Run -> Run As -> Emulated J2ME MIDlet </li></ul></ul><ul><li>It displays the Hello World screen! </li></ul><ul><ul><li>It also prints some properties from your MIDlet (Only in console </li></ul></ul><ul><ul><li>for debug) </li></ul></ul>
    5. 5. Configurations <ul><li>Introduction- Configurations </li></ul><ul><ul><li>Configurations </li></ul></ul><ul><ul><li>Configurations – CLDC </li></ul></ul><ul><ul><li>Configurations – CDC </li></ul></ul><ul><ul><li>ME Platform </li></ul></ul>
    6. 6. Differences between JavaME and JavaSE/EE <ul><li>JavaSE : Single VM specification </li></ul><ul><li>JavaEE : Same VM from SE, new API’s and </li></ul><ul><li>execution environments </li></ul><ul><li>JavaME : “Configurations-based” VM’s. There are </li></ul><ul><li>several VM specifications, to support devices </li></ul><ul><li>with distinct features, from cheap mobile </li></ul><ul><li>phones to TV set-top-boxes with high-speed </li></ul><ul><li>network and wired power supply. </li></ul>
    7. 7. Configurations <ul><li>Address “Horizontal” market segments (Based on the device features, e.g. processing power, available resources (memory, network, power)) </li></ul><ul><li>Define features supported by a VM (e.g. floating </li></ul><ul><li>point support, security model) and basic API’s (e.g. classes at java.lang, java.util, java.io packages). They are composed by a subset of features from a regular VM and by some new API’s. </li></ul><ul><li>Configurations cannot define any optional feature </li></ul>
    8. 8. CLDC: Connected Limited Configuration <ul><li>Most limited configuration </li></ul><ul><li>Devices: Mobile phones and PDA’s with limited power </li></ul><ul><li>and connectivity </li></ul><ul><li>Based on a subset of Java SE 1.3 API’s </li></ul><ul><li>Defines an API for network communication, but does </li></ul><ul><li>not define any protocol </li></ul><ul><li>All other configurations are based on CLDC ( to avoid </li></ul><ul><li>market fragmentation) </li></ul>
    9. 9. CLDC - Security <ul><li>Simplified security model: All classes must be </li></ul><ul><li>preverified and are executed on a restricted </li></ul><ul><li>environment (sandbox): </li></ul><ul><ul><li>User-defined class loaders are not allowed </li></ul></ul><ul><ul><li>All classes must be packaged on a single JAR (you </li></ul></ul><ul><ul><li>cannot download classes or JAR’s from the network) </li></ul></ul><ul><ul><li>Java API classes cannot be replaced by the application </li></ul></ul><ul><ul><li>JNI is not allowed </li></ul></ul>
    10. 10. CLDC - Security <ul><li>Simplified security model: All classes must be </li></ul><ul><li>preverified and are executed on a restricted </li></ul><ul><li>environment (sandbox): </li></ul><ul><ul><li>User-defined class loaders are not allowed </li></ul></ul><ul><ul><li>All classes must be packaged on a single JAR (you </li></ul></ul><ul><ul><li>cannot download classes or JAR’s from the network) </li></ul></ul><ul><ul><li>Java API classes cannot be replaced by the application </li></ul></ul><ul><ul><li>JNI is not allowed </li></ul></ul>
    11. 11. CLDC - Security
    12. 12. CLDC – Available resources <ul><li>No finalization (Object.finalize()) </li></ul><ul><li>No file system (might no make sense on mobile phones) </li></ul><ul><li>No Reflection or Serialization </li></ul><ul><li>Network connectivity though javax.microedition.io ( GCF) </li></ul><ul><li>and not by java.net </li></ul><ul><li>Multi-Threading and synchronization features are </li></ul><ul><li>identical to Java SE </li></ul>
    13. 13. CLDC – API <ul><li>Missing several utility classes: </li></ul><ul><ul><li>java.util.Properties </li></ul></ul><ul><ul><li>java.util.StringTokenizer </li></ul></ul><ul><ul><li>java.util.ResourceBundle </li></ul></ul><ul><li>No Collections Framework: </li></ul><ul><ul><li>java.util.List </li></ul></ul><ul><ul><li>java.util.Iterator </li></ul></ul><ul><ul><li>java.util.Set </li></ul></ul><ul><ul><li>java.util.Map </li></ul></ul><ul><li>But Vector, Hashtable, Stack and Enumeration classes are available. </li></ul>
    14. 14. CLDC – API <ul><li>API classes fit in two groups: </li></ul><ul><ul><li>Inherited classes from Java SE: </li></ul></ul><ul><ul><ul><li>At java.lang , java.io and java.util packages </li></ul></ul></ul><ul><ul><ul><li>Methods and attributes may have been removed </li></ul></ul></ul><ul><ul><ul><li>(e.g. String.equalsIgnoreCase() on CLDC 1.0) </li></ul></ul></ul><ul><ul><ul><li>Java ME specifications WILL NOT add methods or </li></ul></ul></ul><ul><ul><ul><li>classes to these packages </li></ul></ul></ul><ul><li>CLDC-specific classes (Added to javax.microedition </li></ul><ul><li>packages) </li></ul>
    15. 15. CLDC – Versions <ul><li>CLDC 1.0 </li></ul><ul><ul><li>No floating point support </li></ul></ul><ul><ul><li>No Weak References support </li></ul></ul><ul><li>CLDC 1.1 </li></ul><ul><ul><li>Floating point support </li></ul></ul><ul><ul><li>Weak References support </li></ul></ul><ul><ul><li>Requires more memory than 1.0 ( 32 KB) </li></ul></ul>
    16. 16. CLDC – Differences (Brief Review)
    17. 17. <ul><li>Closer to the Java SE than CLDC </li></ul><ul><li>Devices: Set-top boxes and PDA’s </li></ul><ul><li>No need for preverification </li></ul><ul><li>Inherit additional API’s from Java SE </li></ul>CDC: Connected Device Configuration
    18. 18. Java Editions
    19. 19. Profiles <ul><li>Introduction – Profiles and OP’s </li></ul><ul><ul><li>Profiles </li></ul></ul><ul><ul><li>Optional packages </li></ul></ul><ul><ul><li>JTWI </li></ul></ul><ul><ul><li>Requirements </li></ul></ul>
    20. 20. Profiles <ul><li>“ Vertical” market segments (Defined by device </li></ul><ul><li>features, e.g. Mobile phones, PDA’s). </li></ul><ul><li>Define API’s for a range of devices (e.g. user </li></ul><ul><li>interfaces, application life cycle, persistence, </li></ul><ul><li>events, etc.) </li></ul><ul><li>May define optional features </li></ul>
    21. 21. <ul><li>MIDP (Mobile Information Device Profile) </li></ul><ul><ul><li>Designed for mobile phones </li></ul></ul><ul><ul><li>Provides GUI, persistence, networking, multimedia </li></ul></ul><ul><ul><li>Depends on CLDC </li></ul></ul><ul><li>Personal Profile </li></ul><ul><ul><li>Designed for PDA’s and Set-top boxes </li></ul></ul><ul><ul><li>Provides AWT for other Java SE API’s </li></ul></ul><ul><ul><li>Runs on CDC </li></ul></ul>Available Profiles
    22. 22. <ul><li>Defines supplementary API: </li></ul><ul><ul><li>Bluetooth </li></ul></ul><ul><ul><li>3D Graphics </li></ul></ul><ul><ul><li>File system access </li></ul></ul><ul><ul><li>XML Parsing/ Web Services </li></ul></ul><ul><li>Shall be provided by the device vendor, so it’s not possible to “add the API classes” to the environment if you want to use them </li></ul><ul><li>OP’s may define optional features </li></ul>Optional Packages
    23. 23. <ul><ul><li>WMA (JSR – 120) – Wireless messaging API (SMS messages) </li></ul></ul><ul><ul><li>MMAPI (JSR-135) – Mobile Media API (support for audio, </li></ul></ul><ul><ul><li>video and media capture) </li></ul></ul><ul><ul><li>PIM and File API (JSR-75) – Access to device’s file system </li></ul></ul><ul><ul><li>and contact list. </li></ul></ul><ul><ul><li>Web Services (JSR-172) - SOAP calls and XML parsing </li></ul></ul><ul><ul><li>Java API’s for Bluetooth (JSR-82) </li></ul></ul><ul><ul><li>Scalable 2D Vector Graphics for Java ME (SVG Support) </li></ul></ul><ul><ul><li>Mobile 3D Graphics API for Java ME (JSR-184) </li></ul></ul><ul><ul><li>Mobile Internationalization API (JSR-238) </li></ul></ul>Optional Packages
    24. 24. <ul><li>Does not define any new API </li></ul><ul><li>Define requirements over the other API’s aiming </li></ul><ul><li>to reduce platform fragmentation (e.g. when </li></ul><ul><li>you write an application inside the JTWI limits </li></ul><ul><li>you can run it on any device that supports JTWI) </li></ul><ul><li>Define also minimum requirements about hardware and performance </li></ul>JTWI: Java Technology for Wireless Industry
    25. 25. Comparing configurations and profiles
    26. 26. Future Work <ul><li>Next Chapter: </li></ul><ul><ul><li>Introduction to MIDP (Mobile Information Device Profile) </li></ul></ul><ul><ul><li>MIDP - API’s </li></ul></ul><ul><ul><li>MIDlets and MIDlets Suites </li></ul></ul>
    27. 27. References <ul><li>ALVES F. Eduardo. SCMAD Study Guide, </li></ul><ul><li>27/04/2008. </li></ul><ul><li>JAKL Andreas, Java Platform, Micro Edition Part </li></ul><ul><li>01 slides, 12/2007. </li></ul><ul><li>Sun Certification Mobile Application Developer </li></ul><ul><li>Website: [http://www.sun.com/training/certification/java/scmad.xml]. </li></ul>

    ×