Mobile Experiential Track

1,724 views

Published on

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

No Downloads
Views
Total views
1,724
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
122
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Mobile Experiential Track

    1. 1. Mobile Experiential on Java #1 Frans Thamura Arief Purnama Rahmat Azhari
    2. 2. Agenda <ul><li>Java Mobile Technology Overview </li></ul><ul><li>Nokia Devices </li></ul><ul><li>J2ME Development Concept </li></ul><ul><li>Developing with J2ME </li></ul><ul><li>User Interface Programming </li></ul><ul><li>Persistence Storage </li></ul><ul><li>Nokia UI Development </li></ul><ul><li>The Future </li></ul>
    3. 3. Java Mobile Technology Overview
    4. 4. Java Technology <ul><li>Write Once carefully Run Anywhere optionally (WORA) </li></ul>
    5. 5. J2ME and MIDP <ul><li>For Wireless Devices </li></ul><ul><ul><li>Commonly use CLDC Configuration </li></ul></ul><ul><ul><ul><li>Connected Limited Device Configuration </li></ul></ul></ul><ul><ul><ul><ul><li>128kb ROM for JVM and system classes </li></ul></ul></ul></ul><ul><ul><ul><ul><li>32kb RAM (min) for application classes </li></ul></ul></ul></ul><ul><ul><li>MIDP Profile </li></ul></ul><ul><ul><ul><li>Mobile Information Device Profile </li></ul></ul></ul><ul><ul><ul><li>Provides: </li></ul></ul></ul><ul><ul><ul><ul><li>Simple LCD based GUI classes </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Basic networking facilities </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Persistent data </li></ul></ul></ul></ul>
    6. 6. CDLC Features <ul><li>Fundamental packages re-specified </li></ul><ul><li>Most package removed </li></ul><ul><ul><li>java.lang </li></ul></ul><ul><ul><ul><li>System has no in field </li></ul></ul></ul><ul><ul><li>java.io </li></ul></ul><ul><ul><ul><li>No buffered classes </li></ul></ul></ul><ul><ul><li>java.util </li></ul></ul><ul><ul><ul><li>Greatly reduced </li></ul></ul></ul><ul><ul><ul><li>Just 9 classes </li></ul></ul></ul><ul><ul><ul><ul><li>there are 41 in Java 1.4.0 </li></ul></ul></ul></ul><ul><li>No dynamic byte code verification </li></ul><ul><ul><li>J2SE verifier too expensive on memory </li></ul></ul>
    7. 7. Mobile Trend <ul><li>Multipurpose Trend </li></ul>
    8. 8. Mobile Development <ul><li>From Java to Streaming </li></ul>
    9. 9. Mobile Services Value Chain <ul><li>Content Deliverable Concept </li></ul>Content Owner Content Owner
    10. 10. Nokia Devices
    11. 11. Nokia Devices <ul><li>Nokia devices grouped according to capabilities: </li></ul><ul><ul><li>Series 30 </li></ul></ul><ul><ul><li>Series 40 </li></ul></ul><ul><ul><li>Series 60 </li></ul></ul><ul><ul><li>Series 80 </li></ul></ul><ul><ul><li>Series 90 </li></ul></ul>
    12. 12. Nokia Series 30 <ul><li>Cost driven devices </li></ul><ul><li>Nokia OS </li></ul><ul><li>MIDP 1.0, CLDC 1.0 </li></ul><ul><li>Nokia UI API </li></ul><ul><li>XHTML, MMS </li></ul><ul><li>Example: 6310i </li></ul><ul><li>Maximum size of one MIDlet suite: 30 KB </li></ul><ul><li>96x65 pixels </li></ul><ul><li>Maximum data storage space for MIDlet: 20 KB </li></ul>
    13. 13. Nokia Series 40 <ul><li>Size driven colour platform </li></ul><ul><li>Nokia OS </li></ul><ul><li>MIDP 1.0, CLDC 1.0 </li></ul><ul><li>Nokia UI API </li></ul><ul><li>XHTML, MMS </li></ul><ul><li>Example: 7210 </li></ul><ul><li>Maximum size of one MIDlet suite: 64 KB </li></ul><ul><li>128x128 pixels </li></ul>
    14. 14. Nokia Series 60 <ul><li>One hand operated feature platform </li></ul><ul><li>Symbian OS </li></ul><ul><li>MIDP 1.0, CLDC 1.0 </li></ul><ul><li>Nokia UI API (not backlight or vibrate) </li></ul><ul><li>XHTML, MMS </li></ul><ul><li>Example: 7210 </li></ul><ul><li>Memory available to Midlets : 4MB (max) </li></ul><ul><li>176x208 pixels </li></ul>
    15. 15. <ul><li>Nokia 7650 </li></ul><ul><li>Nokia 3650 </li></ul>Nokia Series 60 devices ... basic functionality originates from Series 60 platform on Symbian OS Nokia N-Gage TM mobile game deck device Siemens SX1 Samsung SGH-D700
    16. 16. Nokia Series 60 UI <ul><li>Nokia UI Screen </li></ul>
    17. 17. Nokia Series 80 <ul><li>One hand operated feature platform </li></ul><ul><li>QWERY Keyboard </li></ul><ul><li>Symbian OS </li></ul><ul><li>MIDP 1.0, CLDC 1.0 </li></ul><ul><li>Personal Java, JavaPhone API </li></ul><ul><li>MIDP 2.0 (Nokia 9500 and 9300) </li></ul><ul><li>XHTML, MMS </li></ul><ul><li>Example: 9210 </li></ul><ul><li>Memory available to Midlets : ~14MB </li></ul><ul><li>640x200 pixels </li></ul>
    18. 18. Complementary UI designs Input method One-hand operation Pen input Display size 176 x 208 208-240 x 320 Applications <ul><li>Multimedia messaging </li></ul><ul><li>Imaging </li></ul><ul><li>Entertainment, downloading </li></ul><ul><li>Personal Information Management </li></ul><ul><li>Office connectivity </li></ul><ul><li>Business applications </li></ul><ul><li>Entertainment, downloading </li></ul><ul><li>Personal Information Management </li></ul><ul><li>Web browsing </li></ul><ul><li>Multimedia messaging, Imaging </li></ul>Series 60 Platform UIQ Symbian OS support V7.0 and onwards V6.1 and onwards UIQ
    19. 19. J2ME Development Concept
    20. 20. J2ME Development <ul><li>Can use basic J2ME tools to build apps </li></ul><ul><ul><li>Tool support makes development simpler </li></ul></ul><ul><li>Automated verification and packaging </li></ul><ul><ul><li>Sun J2ME Wireless Toolkit </li></ul></ul><ul><ul><li>Sun Java Studio Mobile Edition </li></ul></ul><ul><ul><li>Borland JBuilder Mobile Toolkit </li></ul></ul><ul><ul><li>Eclipse </li></ul></ul><ul><ul><li>Websphere Devices Developer </li></ul></ul><ul><li>Comes bundled with wireless toolkit </li></ul><ul><li>Simple integration with Nokia SDK </li></ul>
    21. 21. Tool support <ul><li>Nokia Developer’s Suite </li></ul><ul><li>Integrates with JBuilder, or Sun One Studio 4 </li></ul><ul><ul><li>Run as standalone </li></ul></ul><ul><ul><li>Includes Nokia emulators </li></ul></ul><ul><ul><li>6310i </li></ul></ul><ul><ul><li>Symbian </li></ul></ul><ul><li>Download more emulators </li></ul><ul><ul><li>Series 40 and 60 </li></ul></ul><ul><li>Others </li></ul><ul><ul><li>Jakarta Ant? </li></ul></ul>
    22. 22. Developing with MIDP <ul><li>MIDP applications are called Midlets </li></ul><ul><ul><li>Conceptually similar to Applets </li></ul></ul><ul><li>Can be downloaded </li></ul><ul><li>Executed in host environment </li></ul><ul><ul><li>Subclass the MIDlet class </li></ul></ul><ul><li>Provide no argument constructor </li></ul><ul><li>Must not implement main method </li></ul><ul><li>Implement lifecycle methods </li></ul>
    23. 23. Developing Midlets <ul><li>The Midlet lifecycle </li></ul><ul><ul><li>A device will call the methods shown here as appropriate </li></ul></ul><ul><li>Midlet can control its own lifecycle </li></ul><ul><ul><li>notifyPaused() </li></ul></ul><ul><ul><li>notifyDestroyed() </li></ul></ul>
    24. 24. Developing with MIDP <ul><li>Development process </li></ul><ul><ul><li>Subclass MIDlet class </li></ul></ul><ul><ul><li>Override lifecycle methods </li></ul></ul><ul><ul><li>Compile </li></ul></ul><ul><ul><li>Pre-verify </li></ul></ul><ul><ul><li>Package </li></ul></ul><ul><ul><ul><li>Create jar file </li></ul></ul></ul><ul><ul><ul><li>Create application descriptor (jad file) </li></ul></ul></ul><ul><ul><li>Install and run, or emulate </li></ul></ul>
    25. 25. MIDP application structure <ul><li>A MIDP application comprises two files </li></ul><ul><ul><li>jad file (application descriptor) </li></ul></ul><ul><ul><li>jar file </li></ul></ul><ul><ul><li>a Midlet suite is a collection of related Midlets </li></ul></ul>
    26. 26. The jad file <ul><li>A file describing the Midlet suite </li></ul><ul><li>Must include: </li></ul><ul><ul><li>MIDlet-Name </li></ul></ul><ul><ul><ul><li>name of the Midlet suite </li></ul></ul></ul><ul><ul><li>MIDlet-<n> </li></ul></ul><ul><ul><ul><li>A name for each Midlet in the suite </li></ul></ul></ul><ul><ul><li>MIDlet-Version </li></ul></ul><ul><ul><li>MIDlet-Vendor </li></ul></ul><ul><ul><li>MIDlet-Jar-URL </li></ul></ul><ul><ul><li>MIDlet-Jar-Size </li></ul></ul><ul><li>Information regarding the Midlet suite </li></ul><ul><ul><li>May include: </li></ul></ul><ul><ul><ul><li>MIDlet-Description </li></ul></ul></ul><ul><ul><ul><li>MIDlet-Icon </li></ul></ul></ul><ul><ul><ul><li>MIDlet-Info-URL </li></ul></ul></ul><ul><ul><li>MIDlet-Data-Size </li></ul></ul><ul><ul><ul><li>Minimum persistent storage required by suite </li></ul></ul></ul><ul><ul><ul><li>Default is Zero </li></ul></ul></ul>
    27. 27. The jar file <ul><li>Follows standard jar file format </li></ul><ul><ul><li>Manifest to include all data found in jad file </li></ul></ul><ul><ul><ul><li>Except: MIDlet-Jar-Size </li></ul></ul></ul><ul><ul><li>Can include other resources </li></ul></ul><ul><ul><ul><li>E.g: Images </li></ul></ul></ul><ul><ul><li>Must also contain: </li></ul></ul><ul><ul><ul><li>MicroEdition-Profile </li></ul></ul></ul><ul><ul><ul><li>MicroEdition-Configuration </li></ul></ul></ul>
    28. 28. Demo <ul><li>Sun Java Wireless Toolkit </li></ul><ul><li>Nokia J2ME Toolkit </li></ul>
    29. 29. Developing with J2ME
    30. 30. Developing with J2ME <ul><li>Elementary MIDP </li></ul><ul><ul><li>User Interface Programming </li></ul></ul><ul><ul><li>Persisting Data </li></ul></ul><ul><ul><li>Networking </li></ul></ul><ul><li>Extension packages </li></ul><ul><ul><li>Nokia UI API classes </li></ul></ul>
    31. 31. User Interface Programming
    32. 32. User Interface Programming <ul><li>Limitation of display devices </li></ul><ul><ul><li>Colour or Black and White </li></ul></ul><ul><ul><li>Display size & device memory </li></ul></ul><ul><ul><li>Forget about AWT or Swing! </li></ul></ul><ul><ul><ul><li>Too big </li></ul></ul></ul><ul><ul><ul><li>Overly complex </li></ul></ul></ul><ul><ul><ul><li>Tables, Dialogs, Multiple windows </li></ul></ul></ul><ul><li>New API for user interfaces with MIDP </li></ul><ul><ul><li>Lightweight </li></ul></ul><ul><ul><li>Designed for use with small screens </li></ul></ul><ul><ul><ul><li>Based upon single display areas </li></ul></ul></ul>
    33. 33. User Interface Programming <ul><li>LCD user interface API </li></ul><ul><ul><li>In package: </li></ul></ul><ul><ul><ul><li>javax.microedition.lcdui </li></ul></ul></ul><ul><li>Simple structure </li></ul><ul><ul><li>Add Displayable items to a Display! </li></ul></ul><ul><li>Each Midlet has a single Display to use </li></ul><ul><ul><li>Use static method on Display class: </li></ul></ul><ul><ul><ul><li>Display.getDisplay(); </li></ul></ul></ul><ul><li>User interface class hierarchy </li></ul><ul><ul><li>Screens are high level </li></ul></ul><ul><ul><li>Canvas low level (see later) </li></ul></ul>
    34. 34. User Interface Programming (List) <ul><li>A List example: </li></ul><ul><ul><li>list = new List(&quot;Select artist:&quot;, List.EXCLUSIVE); </li></ul></ul><ul><ul><li>list.append(&quot;B2K&quot;,null); </li></ul></ul><ul><ul><li>list.append(&quot;Babyface&quot;,null); </li></ul></ul><ul><li>List types include: </li></ul><ul><ul><li>EXCLUSIVE </li></ul></ul><ul><ul><li>MULTIPLE </li></ul></ul><ul><ul><li>IMPLICIT </li></ul></ul>
    35. 35. User Interface Programming (TextBox) <ul><li>A TextBox example: </li></ul><ul><ul><li>TextBox textBox = new TextBox(&quot;Email address:&quot;,&quot;Text&quot;, 30,TextField.EMAILADDR); </li></ul></ul><ul><ul><li>Text constraints include: </li></ul></ul><ul><ul><ul><li>ANY </li></ul></ul></ul><ul><ul><ul><li>EMAILADDR </li></ul></ul></ul><ul><ul><ul><li>NUMERIC </li></ul></ul></ul><ul><ul><ul><li>PHONENUMBER </li></ul></ul></ul><ul><ul><ul><li>URL </li></ul></ul></ul>
    36. 36. User Interface Programming (Form) <ul><li>Forms </li></ul><ul><ul><li>Like other Screen subclasses </li></ul></ul><ul><ul><ul><li>occupies whole screen </li></ul></ul></ul><ul><ul><ul><li>can have tickers set </li></ul></ul></ul><ul><ul><ul><li>etc... </li></ul></ul></ul><ul><ul><li>Allow multiple items to be added </li></ul></ul><ul><ul><ul><li>there are many subclasses of Item </li></ul></ul></ul><ul><li>A Forms example: </li></ul><ul><ul><li>form = new Form(&quot;Default settings&quot;); </li></ul></ul><ul><ul><li>form.append(new Gauge(&quot;Earpiece volume:&quot;,true,10,5)); </li></ul></ul><ul><ul><li>form.append(new Gauge(&quot;Ringer volume:&quot;,true,10,5)); </li></ul></ul>
    37. 37. User Interface Programming (Command) <ul><li>Notify user generated events </li></ul><ul><ul><li>J2SE applications use an event delegation model </li></ul></ul><ul><ul><ul><li>Explicitly attached to event sources </li></ul></ul></ul><ul><ul><ul><li>Typically results in many anonymous classes </li></ul></ul></ul><ul><ul><ul><ul><li>More efficient to re-use objects </li></ul></ul></ul></ul><ul><ul><li>J2ME applications use Commands </li></ul></ul><ul><ul><ul><li>Many predefined types </li></ul></ul></ul><ul><ul><ul><li>Can be extended with custom types </li></ul></ul></ul>
    38. 38. User Interface Programming (Command) <ul><li>A Commands example: </li></ul><ul><ul><ul><li>Form f = new Form(...); </li></ul></ul></ul><ul><ul><ul><li>f.addCommand(new Command(&quot;Exit&quot;, Command.EXIT, 0)); </li></ul></ul></ul><ul><ul><ul><li>f.setCommandListener(new CommandListener() { </li></ul></ul></ul><ul><ul><ul><li>public void commandAction(Command c, Displayable d) </li></ul></ul></ul><ul><ul><ul><ul><li>{ </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>if (c.getCommandType() == Command.EXIT) { </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>notifyDestroyed(); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>} </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><li>} </li></ul></ul></ul></ul><ul><ul><ul><li>}); </li></ul></ul></ul>
    39. 39. MIDP Development Hierarchy
    40. 40. Demo <ul><li>User Interface Programming </li></ul>
    41. 41. Persistence Storage
    42. 42. Persistent Storage <ul><li>Midlets will need to persist data </li></ul><ul><ul><li>Users name </li></ul></ul><ul><ul><li>Mail host address </li></ul></ul><ul><ul><li>High score for a game </li></ul></ul><ul><li>MIDP includes a specification for Persistent Storage </li></ul><ul><ul><li>R ecord M anagement S ystem (RMS) </li></ul></ul><ul><ul><li>Simple database model </li></ul></ul><ul><ul><li>Holds unique records for each Midlet suite </li></ul></ul><ul><ul><li>Device responsible for storing data </li></ul></ul>
    43. 43. Persistent Storage <ul><li>Each Midlet suite shares records </li></ul><ul><ul><li>Care should be taken with concurrent access </li></ul></ul><ul><ul><ul><li>multiple active Midlets </li></ul></ul></ul><ul><ul><ul><li>multi threaded Midlets </li></ul></ul></ul><ul><ul><ul><ul><li>writes to records guaranteed to be atomic </li></ul></ul></ul></ul><ul><ul><ul><ul><li>program defensively </li></ul></ul></ul></ul><ul><li>Very simple API </li></ul><ul><ul><li>javax.microedition.rms </li></ul></ul><ul><ul><li>Only contains one class! </li></ul></ul><ul><ul><ul><li>and four interfaces </li></ul></ul></ul>
    44. 44. Persistent Storage <ul><li>Records are stored in a Record Store </li></ul><ul><ul><li>Use the RecordStore class </li></ul></ul><ul><ul><li>Each record store is named </li></ul></ul><ul><ul><ul><li>max 32 Unicode chars </li></ul></ul></ul><ul><ul><ul><li>RecordStore rs = null; </li></ul></ul></ul><ul><ul><ul><ul><li>try { </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>rs = RecordStore.openRecordStore(&quot;my-data&quot;,false); </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>} catch(RecordStoreNotFoundException e) </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>{ </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><li>// doesn't exist </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>} catch(RecordStoreException e){ </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><li>// some other error </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>} </li></ul></ul></ul></ul></ul>
    45. 45. Persistent Storage <ul><li>To create a new record </li></ul><ul><ul><li>specify the bytes you want to store </li></ul></ul><ul><ul><li>each record within a store will have a unique number (id). </li></ul></ul><ul><ul><ul><li>RecordStore rs = ...; </li></ul></ul></ul><ul><ul><ul><li>byte[] data = ...; </li></ul></ul></ul><ul><ul><ul><li>int id = -1; //record ids will always be > 0 </li></ul></ul></ul><ul><ul><ul><li>try { </li></ul></ul></ul><ul><ul><ul><li>id = rs.addRecord(data, 0, data.length); </li></ul></ul></ul><ul><ul><ul><li>} ... </li></ul></ul></ul>
    46. 46. Demo <ul><li>Persistence Storage Development </li></ul>
    47. 47. Nokia UI Development
    48. 48. Nokia UI Development <ul><li>MIDP 1.0 UI limited </li></ul><ul><li>Nokia address this with custom UI classes </li></ul><ul><ul><li>Included in upcoming MIDP2.0 specification </li></ul></ul><ul><li>New classes </li></ul><ul><ul><li>FullCanvas </li></ul></ul><ul><ul><li>DirectGraphics </li></ul></ul><ul><ul><li>DirectUtils </li></ul></ul><ul><ul><li>DeviceControl </li></ul></ul><ul><ul><li>Sound </li></ul></ul>
    49. 49. Nokia UI Other <ul><li>Nokia UI supports other features </li></ul><ul><ul><li>Sound </li></ul></ul><ul><ul><li>Device control </li></ul></ul><ul><ul><ul><li>Volume of device </li></ul></ul></ul><ul><ul><ul><li>Backlight </li></ul></ul></ul><ul><ul><ul><li>Vibration </li></ul></ul></ul><ul><li>User preferences may prevent these from being accessible </li></ul>
    50. 50. Application Design <ul><li>Screens are organized into a flow: </li></ul><ul><ul><li>Most require simple behavior </li></ul></ul><ul><ul><li>Some more complex </li></ul></ul>
    51. 51. Adapting to Devices <ul><li>Different devices have different capabilities </li></ul><ul><ul><li>Must cater for these </li></ul></ul>
    52. 52. The Future
    53. 53. J2ME Future <ul><li>Wireless Messaging (WM API, JSR 120) </li></ul><ul><li>Mobile Media (MM API, JSR 135) </li></ul><ul><li>Bluetooth API (JSR 82) </li></ul><ul><li>SyncML </li></ul><ul><li>MMS API (WM API 2.0) </li></ul><ul><li>SIP API </li></ul><ul><li>Game API </li></ul><ul><li>3D API </li></ul>
    54. 54. Thank You Frans Thamura Arief Purnama Rahmat Azhari [email_address]

    ×