Вы находитесь на странице: 1из 28

Java Micro Edition (JME)

Soham Sengupta
Sr. Lecturer, Dept of IT, JIS College of Engineering, Kalyani, India formerly, Systems Engineer Tata Consultancy Services Author, Developerworks, IBM, US Community Member, Nokia Wireless(JME) Forum
4/28/2012 sohamsengupta@yahoo.com 1

Java And Its Three Editions


Java is the oldest, and most robust, platform independent open source language-turned-to-technology,having 3 editions till date J2SE (Java 2 Standard Edititon) J2EE (Java 2 Enterprise Edition) J2ME (Java 2 Micro Edition)
4/28/2012 sohamsengupta@yahoo.com 2

J2ME what and why?


With the advancement of wireless communication systems the market for Mobile Handset manufacturers has soared Different Manufacturers with different OS and hardware. So, the task of mobile software maintenance and making becomes difficult and no single programmer can master all languages. Since Java is platform independent, the issue is resolved
4/28/2012 sohamsengupta@yahoo.com 3

4/28/2012

sohamsengupta@yahoo.com

J2ME Versus J2SE & J2EE

4/28/2012

sohamsengupta@yahoo.com

Why the term ME


ME in J2ME stands for Micro Edition as it is supposed to run in an environment that has little processing power and very less amount of RAM as compared to a PC. KVM: Stands for Kilobyte Virtual Machine as it needs RAM in the order of Kilo Bytes where as in case of JVM, it is in the order of Mega Bytes. This is the interface between native platform and java byte code thats platform independent.
4/28/2012 sohamsengupta@yahoo.com 6

Backbone of J2ME

4/28/2012

sohamsengupta@yahoo.com

J2ME Architecture

4/28/2012

sohamsengupta@yahoo.com

MIDP

4/28/2012

sohamsengupta@yahoo.com

APIs overview

4/28/2012

sohamsengupta@yahoo.com

10

J2ME Forum
Sun Micro Systems has joined in hands with IBM, Nokia, Motorola, Ericsson, Samsung et al formed a J2ME forum that is till date contributing to the world of Mobile Software. The greatest challenge till date is Standardizing a Speech Recognition API JSR 113 for Micro Edition and its one of the biggest challenge before J2ME Forum as J2ME did not support floating point arithmetic and hence complex mathematical computation.
4/28/2012 sohamsengupta@yahoo.com 11

MIDlet as unit of JME Application

4/28/2012

sohamsengupta@yahoo.com

12

MIDlet Life Cycle

4/28/2012

sohamsengupta@yahoo.com

13

Building A J2ME Project

4/28/2012

sohamsengupta@yahoo.com

14

User Interface

4/28/2012

sohamsengupta@yahoo.com

15

User Interface Hierarchy

4/28/2012

sohamsengupta@yahoo.com

16

4/28/2012

sohamsengupta@yahoo.com

17

4/28/2012

sohamsengupta@yahoo.com

18

Getting Started with Sun Wireless Toolkit 2.2

4/28/2012

sohamsengupta@yahoo.com

19

Creating a Project with WTK 2.2

4/28/2012

sohamsengupta@yahoo.com

20

4/28/2012

sohamsengupta@yahoo.com

21

4/28/2012

sohamsengupta@yahoo.com

22

4/28/2012

sohamsengupta@yahoo.com

23

4/28/2012

sohamsengupta@yahoo.com

24

package com.webel;

Codes Explanation

import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class MIDletWEBEL extends MIDlet implements CommandListener { private Display display=null; private Command cmdExit=null; private Command cmdSayHello=null; private Form form=null;
April 28, 2012 sohamsengupta@yahoo.com 25

Constructor: Codes Continued


public MIDletWEBEL(){ display=Display.getDisplay(this); cmdExit=new Command("EXIT",Command.EXIT,1); cmdSayHello=new Command("Say Hello",Command.SCREEN,1); form=new Form("Demo for WEBEL"); form.addCommand(cmdExit); form.addCommand(cmdSayHello); form.setCommandListener(this); display.setCurrent(form); }
4/28/2012 sohamsengupta@yahoo.com 26

Callback Methodscodes contd


public void startApp(){ } public void pauseApp(){ } public void destroyApp(boolean boolUC){ }
4/28/2012 sohamsengupta@yahoo.com 27

Listener Methodcodescontd..
public void commandAction(Command cmd,Displayable displ){ if(cmd==cmdExit){ destroyApp(true); notifyDestroyed(); } if(cmd==cmdSayHello){ Alert alert=new Alert("Hello Students","Hi Friends!",null,AlertType.INFO); alert.setTimeout(5000); display.setCurrent(alert); } }
4/28/2012 sohamsengupta@yahoo.com 28

Вам также может понравиться