0
Lab 1Introduction to J2ME      Pervasive Computing Lab      Prepared by: Tuan Nguyen   E-mail: T.Nguyen@latrobe.edu.au
Java Micro-Edition  Image from java.sun.com
K virtual machine• The K virtual machine (KVM) is Suns newest  Java virtual machine technology and is  designed for produc...
Configuration for Small Devices-CLDC• CLDC: The Connected Limited Device  Configuration.  – Example: devices with 128 to 5...
MIDP• Mobile Information Device Profile (MIDP): A  widely adopted example is to combine the  CLDC with the MIDP to provide...
What is JSR ?• The Java Community Process (JCP): is a  participative process to develop and revise the  Java™ technology s...
MIDLet Life Cycle*• MIDP applications are managed by the  Application Management Software (AMS) on  devices.• The AMS star...
MIDLet Life Cycle Methods      Method                        DescriptionstartApp()          Called by the AMS when the MID...
HelloWorld.javaimport javax.microedition.lcdui.*;import javax.microedition.midlet.*;public class HelloWorld extends MIDlet...
Run project• Click on  Run  button
Examine the files• Check those directory:   – .bin ; .classes; .res• Examine the file: .binHelloWorld.jad and  .binMANIFES...
References1. Java.sun.com2. JCP – http://jcp.org3. Michael Juntao Yuan, Enterprise J2ME   Developing Mobile Java Applicati...
Upcoming SlideShare
Loading in...5
×

Lab 1 new

198

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
198
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Lab 1 new"

  1. 1. Lab 1Introduction to J2ME Pervasive Computing Lab Prepared by: Tuan Nguyen E-mail: T.Nguyen@latrobe.edu.au
  2. 2. Java Micro-Edition Image from java.sun.com
  3. 3. K virtual machine• The K virtual machine (KVM) is Suns newest Java virtual machine technology and is designed for products with approximately 128K of available memory.• This environment is highly optimized for small- memory limited-resource connected devices such as cellular phones, pagers, PDAs• http://java.sun.com/products/cldc/wp/
  4. 4. Configuration for Small Devices-CLDC• CLDC: The Connected Limited Device Configuration. – Example: devices with 128 to 512KB of memory available for Java applications. Mobile phones, PDAs
  5. 5. MIDP• Mobile Information Device Profile (MIDP): A widely adopted example is to combine the CLDC with the MIDP to provide a complete Java application environment for mobile phones and other devices with similar capabilities.• The latest versions of MIDP is 2.1• The latest versions of CLDC 1.1
  6. 6. What is JSR ?• The Java Community Process (JCP): is a participative process to develop and revise the Java™ technology specifications, reference implementations, and test suites (http://jcp.org)• Java Specification Requests – JSR-82: Bluetooth API – JSR-120: Wireless Messaging API – JSR-179: Location API• Find suitable devices: – Ex: http://www.forum.nokia.com/devices/E61i
  7. 7. MIDLet Life Cycle*• MIDP applications are managed by the Application Management Software (AMS) on devices.• The AMS starts, stops, or pauses the MIDP application by calling its main MIDlet class’s life cycle methods.• The MIDlet can also notify the AMS when its state changes.• javax.microedition.midlet.MIDlet *: M. J. Yuan, Enterprise J2ME Developing Mobile Java Application, Prentice Hall, 2004
  8. 8. MIDLet Life Cycle Methods Method DescriptionstartApp() Called by the AMS when the MIDlet starts to recover from the pause statedestroyApp() Called by the AMS when the MIDlet is terminatedpauseApp() Called by the AMS when the MIDlet is pausednotifyDestroyed() Called by the MIDlet. It asks the AMS to destroy the MIDlet itselfnotifyPaused() Called by the MIDlet. It asks the AMS to pause the MIDlet itself.resumeRequest() Called by the MIDlet. It notifies the AMS that MIDlet desires to come out of the paused state and become active again
  9. 9. HelloWorld.javaimport javax.microedition.lcdui.*;import javax.microedition.midlet.*;public class HelloWorld extends MIDlet { Alert strAlert; public HelloWorld() { strAlert = new Alert("Alert!"); strAlert.setString("Hello World") } public void startApp() { Display.getDisplay(this).setCurrent(strAlert); } public void pauseApp() {} public void destroyApp(boolean unconditional) {}}
  10. 10. Run project• Click on Run button
  11. 11. Examine the files• Check those directory: – .bin ; .classes; .res• Examine the file: .binHelloWorld.jad and .binMANIFEST.MF – MIDlet-1: HelloWorld, HelloWorld.png, HelloWorld – MIDlet-Jar-Size: 100 – MIDlet-Jar-URL: HelloWorld.jar – MIDlet-Name: HelloWorld – MIDlet-Vendor: Unknown – MIDlet-Version: 1.0 – MicroEdition-Configuration: CLDC-1.1 – MicroEdition-Profile: MIDP-2.1
  12. 12. References1. Java.sun.com2. JCP – http://jcp.org3. Michael Juntao Yuan, Enterprise J2ME Developing Mobile Java Application, Prentice Hall, 20044. www.forum.nokia.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×