SlideShare a Scribd company logo
1 of 76
Java Platform, Micro Edition
(J2ME)
Click to add text

J2ME

1
Contents
 J2ME:


Why?



What?



Who?

 J2ME

core.
 Installation
 Demo
J2ME

2
Introduction
 Why?

– To have the ability to program to
day to day devices such as:
 cell

phones
 smart cards
 personal organizers , palmtops
 What?

– A java base platform for such
customizations.
 Who? Sun!!!, But also vendors like Nokia , …
J2ME

3
Java? – J2ME



Java – “write once run anywhere”
But:



Different devices have different requirements.
Those devices doesn’t have the same environment as regular
computers (standard desktop), the constrains we have:







Limited memory and processor.
Small screen sizes.
Alternative input methods.

One platform (solution) cannot address all the market
segments (web server, video games etc.)
Users/developers want flexibility. They want to choose what
they want to use and what they don’t.

 Sun

decided to develop a special edition of
Java – J2ME (Java 2 Micro Edition).
J2ME

4
Features
Robust
, Flexible environment
, Secure
built-in network protocols
supports for networked
.offline applications

•
•
•
•
•
•
Java Editions


The Java 2 Platform is split into three editions:










Java 2 Standard Edition (J2SE) - Desktop-based applications.
Java 2 Enterprise Edition (J2EE) - Server-based applications.
Java 2 Micro Edition (J2ME) – For handheld and embedded
devices.

Each edition provides a complete environment for
running Java-based applications including the Java
virtual machine (VM) and runtime classes.
What separates one edition from another, then, is
primarily the set of class libraries that each edition
defines.
you can think of J2ME as a subset of J2SE and J2SE
as a subset of J2EE.
J2ME

6
What will we know.

J2ME

7
Relative Features of various VMs
JVM

Java
Spec

Target Devices

Processor

Memory

HotSpot
VM

J2EE

Enterprise Servers

Up to 64 bit

Upwards of 2 MB

HotSpot
VM

J2SE

Workstations, Desktop Clients,
Laptops

32-64 bit

Upwards of 2MB

CVM

J2ME

High end, consumer electronic and
embedded devices like wireless
communicators eg. devices running
Symbian's EPOC OS), high-end
PDAs (e.g. devices running
embedded Linux or Windows CE),
residential gateways, automotive
telematic systems, set-top boxes and
screen phones
Cell Phones, Pagers, PDAs

32 bit

2MB – 10 MB

KVM

Card VM

J2ME

Java Card

Smart Cards

Min 512Kb ROM
Min 256 kB RAM
Relatively
constrained GUI

16 bit

160-512 kB

8 bit

Highly constrained
GUI
<32 kB
Java platform for mobile devices and embedded systems
Resource-constrained in terms of CPU, memory, energy
Smallest footprint and smallest VM –

•
–

Differentiates between different types of resource-constrained devices
Some with more resources, such as set up boxes, automobile –
navigation systems
More constrained devices, such as cellular phones, PDAs, pagers –
Architecture has four layers

•

JVM that sits on top of the operating system
The configuration layer –
The profile layer

•

–

–

Optional packages layer –
Optional Packages

Optional Packages

Personal Profile

Mobile Information Device Profile

Foundation Profile

)MIDP(

Connected Device Configuration

Connected Limited Device Configuration

)CDC(

)CLDC(

Java Virtual Machine
Operating System
Optional Packages

Optional Packages

Personal Profile

Mobile Information Device Profile

Foundation Profile

)MIDP(

Connected Device Configuration

Connected Limited Device Configuration

)CDC(

)CLDC(

Java Virtual Machine
Operating System
Java Programming Language
and VM features

Floating point support
Float and Double

•

–

Calendar, Date, Timezone, and Thread objects redesigned to be more
Java SE-compliant
:JVM the same as the one used in Java SE, except
No finalization of class instances

–

Method Object.finalize() not included

•

Exemption and error handling limitations

–

User-defined class loaders are not supported

–

Thread groups not supported; only individual threads
Class file verification not supported

•

–

Only offline preverification with stack maps

•

–

•
The Preverification Process
J2ME Core Concepts
 At

the heart of Java 2 Micro Edition (J2ME) are
three core concepts: configurations, profiles,
and optional packages.
 You can't write a J2ME application without
understanding these concepts, because they
determine the features of Java that you can
use, which application programming interfaces
(APIs) are available, and how your applications
are packaged.
J2ME

16
:J2ME Delivers
:Two Configurations
CDC – Connected Device Configuration

•

CLDC – Connected, Limited Device Configuration

•

•

:Two major Profiles
MIDP – Mobile Information Device Profile

•

Foundation Profile

•

Others Upcoming – PDA Profile, Personal Profile, RMI Profile,
Java Game Profile, MIDP_NextGen Profile

•

•
J2ME Core Concepts


Profile:
 A collection of Java Classes
selected from one or more
Java core, extension or
vertical APIs. Classes are
chosen to provide a

complete solution for
a specific vertical market



Configuration:
 A subset of the Java core
APIs and Java language
functionality selected to
provide a minimal Java
platform for a set of
vertical markets

J2ME
Profile

J2ME
Libraries
Java Language
Java Virtual Machine

Profiles

Optional Packages

Configuration



Host Operating System
J2ME

19
J2ME Core Concepts


Profile:
 A collection of Java Classes
selected from one or more
Java core, extension or
vertical APIs. Classes are
chosen to provide a

complete solution for
a specific vertical market



Configuration:
 A subset of the Java core
APIs and Java language
functionality selected to
provide a minimal Java
platform for a set of
vertical markets

J2ME
Profile

J2ME
Libraries
Java Language
Java Virtual Machine

Profiles

Optional Packages

Configuration



Host Operating System
J2ME

20
Java ME technology comprises
:with three elements as
Configuration •
Profile •
Optional package •
What it all means
 There

is no "J2ME application“:

 Configuration,

profile and optional packages
should be chosen.

A

configuration is a complete Java runtime
environment:
 Java

virtual machine (VM) to execute Java.
 Set of core Java runtime classes
 Interface to the underlying system
J2ME

22
ME Configuration are 2 types
J2ME Configuration are 2 types •
Connected Limited Device. 1 •
)Configuration (CLDC
Connected Device Configuration. 2 •
)(CDC
Configurations-1: CDC
CDC is based on CVM

•

The CVM is a full-featured, Java 2 Virtual Machine;
designed for devices needing the functionality of the Java 2
.VM feature set

•

The CDC is a configuration that could become interesting
for mobile terminals as their capabilities increase

•

CDC targets networked devices with relatively constrained
.Graphical user Interfaces

•

Basic packages: java.lang, java.util, java.net, java.io,
java.text, java.security

•
Configurations-2: CLDC
CLDC is based on KVM •
:Limitations w.r.t. J2SE •
)No support for JNI (Java Native Interface
Limited bytecode verifier •
Limited support for internationalization •
No support for object finalization •
No thread groups and daemon threads •
Limited error handling •
Simplified sandbox security model •
No certificates supported •
No refection: No Serialization, RMI or JINI

•

•

Features like Floating point support and J2ME Web
Services support added in latest CLDC v1.1

•
What it all means
 The

profile adds classes to a configuration:

To fill in missing functionality
 To support specific uses of a device


 The

Optional Packages are set of APIs that

support additional and common behaviors.


Examples of optional packages :
Bluetooth Optional Package
 JDBC Optional Package


J2ME

27
Configuration
 There
 The

are 2 basic configurations.

superset:

 CDC (Connected Device Configuration):
2

MB or more memory for Java platform.
 32-bit processor.
 High bandwidth network connection.
 full-featured Java 2 virtual machine (CVM).
 17 packages.
 Use for devices like Palms.
J2ME

28
CLDC is a configuration for small •
devices. Connected Limited Device
Configuration is designed in such a way
that the devices with limited resources
can run on Java platform, limited
resources specifies that limited memory,
processing power, and graphical
.capabilities
It uses KVM •
:Ex: pagers, cell phones, etc •
• 160 - 512 KB of total memory
• 16-bit or 32-bit processor
• Low power consumption and often
operating with battery power
• Connectivity with limited bandwidth
• Selected classes from:
• java.lang , java.io , java.util
Handling I/O in CDC / CLDC
 The

CLDC has defined a new set of APIs for
I/O called the Generic Connection Framework.
 The GCF, part of the new javax.microedition.io
package, defines interfaces for the different
kinds of I/O that are possible.
 Since the CDC is a superset of the CLDC, it
includes the GCF.
 CDC also requires GCF support for two
specific connection types: files and datagrams
since it includes the relevant classes from
java.io and java.net packages.
J2ME

32
CDC
CDC is a configuration for more capable •
. devices and smart phones
Connected Device Configurationis •
:designed for for example
smart phones, embedded device can •
run on Java Platform.Minimum
It uses JVM •
Configuration - What it all means
 CDC-based

profiles make development
simpler due to J2SE-like APIs, but don’t
suit the low-end devices.
 CLDC-based profiles makes the
development task harder, especially
when trying to shrink the size of the
application to run on many of the small
devices.
J2ME

34
Profile


Several profiles in various stages of development:









Mobile Information Device Profile (MIDP) - CLDC-based,
used for running applications on cellphones and interactive
pagers with small screens, wireless HTTP connectivity, and
limited memory.
Personal Digital Assistant Profile (PDAP) – CLDC-based,
extends MIDP with additional classes and features for more
powerful handheld devices.
Foundation Profile (FP) – CDC-based, extends the CDC with
additional J2SE classes.
Personal Basis Profile (PBP) - extends the FP with
lightweight (AWT-derived) user interface classes and a new
application model.
Personal Profile extends the PBP with applet support and
heavyweight UI classes.
J2ME

35
• The profile consists of java classes to a
configuration:
• To fill in missing functionality
• To support specific uses of a device
Profile
 The

CLDC-profile used today:
MIDP (Mobile Information Device Profile)
 The MIDP defines a platform for dynamically
and securely deploying optimized, graphical,
networked applications.
 The MIDP specification was defined through
the Java Community Process (JCP) by players
like: Motorola, Nokia, Ericsson, Research in
Motion, and Symbian.
J2ME

37
MIDP – MID Profile
 MIDP

is targeted at a class of devices
known as mobile information devices
(MIDs).
 Minimal characteristics of MIDs:
 Enough

memory to run MIDP applications
 Display of at least 96 X 56 pixels, either
monochrome or color
 A keypad, keyboard, or touch screen
 Two-way wireless networking capability
J2ME

38
)MIDP (Mobile Information Device Profile

• The MIDP defines a platform for
dynamically and securely deploying
optimized, graphical, networked
applications.
• The MIDP specification was defined
through the Java Community Process
(JCP) by players like: Motorola, Nokia,
Ericsson, Research in Motion, and
Symbian.
MIDP - Specification
 There

are two versions of the MIDP:



MIDP 1.0 - is the original specification, provides
core application functionality required by mobile
applications, including basic user interface and
network security



MIDP 2.0 - is a revised version of the MIDP 1.0.
Have new features include an enhanced user
interface, multimedia and game functionality, more
extensive connectivity, over-the-air provisioning,
and end-to-end security.
J2ME

40
…MIDlets – The heart of J2ME
 MIDP

does not run in the “regular” Java fashion.
using: Main() , System.exit().
 Instead, we use MIDlet aplications - which are
subclasses of: javax.microedition.midlet.MIDlet
that is defined by MIDP.
 The MIDlet class allows the application
management software to:
control the MIDlet
 be able to retrieve properties from the application
descriptor
 notify and request state changes


J2ME

41
…MIDlets – The heart of J2ME

 The

extending class is the main class of
the application.
 The MIDlet class defines abstract
methods that the main class implements
(for example: startApp(), destroyApp(),
notifyDestroyed()).
J2ME

42
MIDlet Suite
 One

or more MIDlets are packaged together
into a MIDlet suite, composed of:
JAR (Java archive) file - The JAR file contains Java
classes for each MIDlet in the suite and Java
classes that are shared between MIDlets. The JAR
file also contains resource files used by the MIDlets
and a manifest file.
 JAD (Java Application Descriptor) file - This file
contains a predefined set of attributes that allows the
device application management software to identify,
retrieve, and install the MIDlets


 Eventually

the JAR / JAD files are upload to the
machine in order to run the application.
J2ME

43
Configuration + Profile
 When

the Java 2 Platform, Micro Edition
(J2ME) was first introduced, only one
configuration, the Connected Limited Device
Configuration (CLDC), and one profile, the
Mobile Information Device Profile (MIDP) had
been defined as formal specifications.
 Today, there are nearly forty J2ME-related
specifications at various stages in the JCP,
and many of these specifications define
optional packages instead of configurations or
profiles.
J2ME

44
So what is an optional package?
 An

optional package is also a set of APIs, but
unlike a profile, it does not define a complete
application environment.
 An optional package is always used in
conjunction with a configuration or a profile. It
extends the runtime environment to support
device capabilities that are not universal enough
to be defined as part of a profile or that need to
be shared by different profiles.
 Examples:
RMI Optional Package (Remote Method Invocation).
 Wireless Messaging API.
 Mobile Media API


J2ME

45
Extenders
 There

are some companies that created
different suite for J2ME.
 Those companies are “competing partners”
with Sun (- they buy the KVM from Sun).
 Example:
 Nokia’s

Developer's Suite:
provides tools for creating application classes
and packages, signing the application, and
deploying it to a device. It is also an essential
tool for managing, configuring, and running
emulators for various Nokia Platform.
J2ME

46
What we know so far:

J2ME

47
summary


Java 2 Micro Edition defines a small footprint version of
Java for resource constrained devices. Specifically, code
space of <512K and RAM (for java heap) of 64KBytes or
more.



The Connected Limited Device Configuration (CLDC)
defines the minimum required complement of Java
technology components and libraries for small connected
devices. Java language and virtual machine features, core
libraries, input/output, networking and security are the
primary topics addressed by this specification.



The Mobile Information Device Profile (MIDP) defines an
additional set of API’s on top of the Connected Limited
Device Configuration (CLDC) for small handheld devices
such as PDA’s and cellular phones. These include UI,
Persistence, Networking, Timers, and Application Lifecycle.
J2ME

48
J2ME

49
Requirements







Java2 SE SDK 1.4.x (Can be downloaded at:
http://java.sun.com/j2se/1.4.2/download.html)
The Eclipse IDE 3.x (Can be downloaded at:
http://www.eclipse.org/downloads/index.php)
A supported wireless toolkit (A List of supported
toolkits can be found at:
http://eclipseme.org/docs/support_wtk.html)
Any kind of Emulator
EclipseME 1.x.x
version 1.1.0 (supports Eclipse 3.1 only)
 version 1.0.1 (either Eclipse 3.0 or Eclipse 3.1 are
supported)
 prior 1.0.0 (support Eclipse 3.0 only)


J2ME

50
:Minimum requirements for hardware
Hard Disk 100 MB
RAM 128 MB
CPU 800 MHz Pentium III

•
•
•
•
Installation







Verify J2SE SDK is installed on your system (1.4.2 and
later is preferable)
Verify Eclipse 3.0 or later is installed on your system
Install a Wireless Toolkit
 J2ME Wireless Toolkit 2.2 + Patch (Can be downloaded
at:
http://java.sun.com/products/sjwtoolkit/download-2_2.html
)
 Nokia S40 DP20 SDK 6230i 1.0 (Can be downloaded at:
http://forum.nokia.com) install either integrated with
J2ME WT or as Standalone
Install an Emulator
Install EclipseME
J2ME

52
Verify Plug In installation


If the J2ME plug-in is properly installed, there will be a J2ME
entry in the Window / Preferences dialog

J2ME

53
Verify Wireless Toolkit Installed
Select the Preferences
menu item from Eclipse's
Window menu.
 Expand the J2ME item in
the pane to the left and
click on Platform
Components.
 Verify that the Wireless
Toolkits appears
 If not right click on the
Wireless Toolkit and add
the root directory.


J2ME

54
Create New Midlet Suite


Create a new project
 File -> new -> Project

J2ME

55
Project properties


Give a name to the project and Select the location on the
disk

J2ME

56
Select Wireless Toolkit


Select the Wireless Toolkit you wish to work with

J2ME

57
Creating a new MIDlet
 On

the ToolBar Select File -> New -> Other

J2ME

58
MIDlet Properties
 Select

a Name for the Midlet, Superclass and
implemented interfaces.

J2ME

59
The MIDlet content

J2ME

60
Importing Packages

Importing MIDP
specific
packages

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

J2ME

61
LCDUI





The UI API provides a set of features for implementation
of user interfaces for MIDP applications.
The central abstraction of the MIDP's UI is a Displayable
object, which encapsulates device-specific graphics
rendering with user input. Only one Displayable may be
visible at a time, and the user can see and interact with
only contents of that Displayable.
The Screen class is a subclass of Displayable that takes
care of all user interaction with high-level user interface
component. The Screen subclasses handle rendering,
interaction, traversal, and scrolling, with only higher-level
events being passed on to the application.
J2ME

62
Superclass And Interface
Extends MIDlet
Implements
CommandListener

public class TestMIDlet
extends MIDlet
implements CommandListener {

J2ME

63
MIDlet API

 Abstracts:


protected abstract void startApp() –
Signals the MIDlet that it has entered the Active state



protected abstract void pauseApp() –
Signals the MIDlet to enter the Paused state



protected abstract void destroyApp(boolean arg0) Signals the MIDlet to terminate and enter the Destroyed state
J2ME

64
MIDlet API
 Inherited:
 Int

checkPermission(String permission)
 String getAppProperty(String key)
 Void notifyPaused()
 Boolean platformRequest(String URL)
 Void resumeRequest()
 Void notifyDestroyed() - Used by an MIDlet to
notify the application management software
that it has entered into the Destroyed state.
J2ME

65
CommandListener API
 This

interface is used by applications
which need to receive high-level events
from the implementation.

 public

void
commandAction(Command c,
Displayable d) - Indicates that a
command event has occurred on
Displayable d
J2ME

66
The MIDlet content
Creating the
form, adding
the
Commands

public TestMIDlet() {
mMainForm = new Form(“Ahalan");
mMainForm.append(new StringItem(null,
“First Message"));
mMainForm.addCommand(new Command("Exit",
Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
J2ME

67
Form class
A

Form is a Screen that contains an arbitrary
mixture of items: images, read-only text fields,
editable text fields, editable date fields,
gauges, choice groups, and custom items.

 In

general, any subclass of the Item class may
be contained within a form.

 The

implementation handles layout, traversal,
and scrolling.
J2ME

68
Form and Item classes

J2ME

69
Test your code
 Choose

the target

platform
 Choose the
desired Device
(Emulator)
 Run

J2ME

70
Choose your device

J2ME

71
Distribution to actual devices
 Create

a package
 Place your code somewhere on the net.
 Update .jad file
 Download the application to your mobile
 Run the application

J2ME

72
J2ME

73
The SMS server


We have build a MIDlet that acts as an SMS server.



The MIDlet listens to incoming SMS events. If the
SMS matches a predefined pattern, it is processed as
a command.



We have defined a few sample commands:






Add a contact to the device’s phonebook
Flash the backlights
Turn on vibrating mode

Many more option can be added. For example:


A command that will order the phone to take a snapshot using
it’s built-in camera
J2ME

74
Nokia Connectivity Framework








Nokia Connectivity Framework (NCF) is a tool, which
manages, configures and integrates products so that
they can communicate with each other and with exterior
integratable hardware or software.
NCF provides an integration platform for delivering
content data in mobile development environment
between the connected external software components.
For example, phone emulators, content development
tools, software development tools, real time server
emulators and server emulators.
With the aid of NCF a user can construct, maintain,
modify and use development environments that support
different technologies, formats, and versions.
J2ME

75
Nokia Connectivity Framework

 We

will use the framework to display a
demonstration of the SMS server MIDlet.
 We will use the framework to simulate two
phones and the two-way communication
between them.
J2ME

76
J2ME

77

More Related Content

What's hot

Technologies Skills
Technologies SkillsTechnologies Skills
Technologies SkillsDeepak Raj
 
Physical computing and iot programming final with cp sycs sem 3
Physical computing and iot programming final with cp sycs sem 3Physical computing and iot programming final with cp sycs sem 3
Physical computing and iot programming final with cp sycs sem 3WE-IT TUTORIALS
 
Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security ArchitectureRamesh Nagappan
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)denian00
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Androidma-polimi
 
Training - Managing .NET/J2EE Projects
Training - Managing .NET/J2EE ProjectsTraining - Managing .NET/J2EE Projects
Training - Managing .NET/J2EE ProjectsShashank Banerjea
 
Wireless lan scope and sequences
Wireless lan scope and sequencesWireless lan scope and sequences
Wireless lan scope and sequencesKumar
 
ASICSoft Technologies Overview - R&D
ASICSoft Technologies Overview - R&DASICSoft Technologies Overview - R&D
ASICSoft Technologies Overview - R&DTony Devlin
 
Andriod - Technical Review
Andriod - Technical ReviewAndriod - Technical Review
Andriod - Technical ReviewFolio3 Software
 
Overview
OverviewOverview
Overviewhendriv
 
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesOperating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesFatih Özlü
 
Symbian Os Introduction
Symbian Os IntroductionSymbian Os Introduction
Symbian Os IntroductionDeepak Rathi
 

What's hot (19)

Technologies Skills
Technologies SkillsTechnologies Skills
Technologies Skills
 
Mobile Java
Mobile JavaMobile Java
Mobile Java
 
509 512
509 512509 512
509 512
 
Physical computing and iot programming final with cp sycs sem 3
Physical computing and iot programming final with cp sycs sem 3Physical computing and iot programming final with cp sycs sem 3
Physical computing and iot programming final with cp sycs sem 3
 
Java Platform Security Architecture
Java Platform Security ArchitectureJava Platform Security Architecture
Java Platform Security Architecture
 
CLV_Viswanath_K
CLV_Viswanath_KCLV_Viswanath_K
CLV_Viswanath_K
 
Android unveiled (I)
Android unveiled (I)Android unveiled (I)
Android unveiled (I)
 
Introduction To Android
Introduction To AndroidIntroduction To Android
Introduction To Android
 
Training - Managing .NET/J2EE Projects
Training - Managing .NET/J2EE ProjectsTraining - Managing .NET/J2EE Projects
Training - Managing .NET/J2EE Projects
 
Wireless lan scope and sequences
Wireless lan scope and sequencesWireless lan scope and sequences
Wireless lan scope and sequences
 
ASICSoft Technologies Overview - R&D
ASICSoft Technologies Overview - R&DASICSoft Technologies Overview - R&D
ASICSoft Technologies Overview - R&D
 
Andriod - Technical Review
Andriod - Technical ReviewAndriod - Technical Review
Andriod - Technical Review
 
Overview
OverviewOverview
Overview
 
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesOperating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
 
Rashmi_Resume
Rashmi_ResumeRashmi_Resume
Rashmi_Resume
 
Windows CE
Windows CEWindows CE
Windows CE
 
Symbian OS
Symbian OSSymbian OS
Symbian OS
 
Visual Basic User Interface-III
Visual Basic User Interface-IIIVisual Basic User Interface-III
Visual Basic User Interface-III
 
Symbian Os Introduction
Symbian Os IntroductionSymbian Os Introduction
Symbian Os Introduction
 

Similar to J2 me 1

010118565.pdf
010118565.pdf010118565.pdf
010118565.pdfEidTahir
 
Mobile operating system..
Mobile operating system..Mobile operating system..
Mobile operating system..Aashish Uppal
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSSenthil Kanth
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Wambua Wambua
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Wambua Wambua
 
Introduction to java micro edition
Introduction to java micro editionIntroduction to java micro edition
Introduction to java micro editionRaphael Wanjiku
 
JavaME Development Workflow - JMDF 2007
JavaME Development Workflow - JMDF 2007JavaME Development Workflow - JMDF 2007
JavaME Development Workflow - JMDF 2007Edoardo Schepis
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app developmentMuthu Kumar
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application DevelopmentSenthil Kanth
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDPSMIJava
 
Mobile Application Development MAD J2ME
Mobile Application Development  MAD J2MEMobile Application Development  MAD J2ME
Mobile Application Development MAD J2MEPallepati Vasavi
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introductionmuthusvm
 
2 mobile development frameworks and tools dark temp
2   mobile development frameworks and tools dark temp2   mobile development frameworks and tools dark temp
2 mobile development frameworks and tools dark tempShahid Riaz
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development EnvironmentPredhin Sapru
 

Similar to J2 me 1 (20)

J2ME
J2MEJ2ME
J2ME
 
J2ME
J2MEJ2ME
J2ME
 
010118565.pdf
010118565.pdf010118565.pdf
010118565.pdf
 
J2me Platform
J2me PlatformJ2me Platform
J2me Platform
 
Mobile operating system..
Mobile operating system..Mobile operating system..
Mobile operating system..
 
MOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMSMOBILE APPs DEVELOPMENT PLATFORMS
MOBILE APPs DEVELOPMENT PLATFORMS
 
Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)Introduction to mobile programing (J2ME)
Introduction to mobile programing (J2ME)
 
Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)Introduction to Mobile programming(J2ME)
Introduction to Mobile programming(J2ME)
 
Java J2ME
Java J2MEJava J2ME
Java J2ME
 
Introduction to java micro edition
Introduction to java micro editionIntroduction to java micro edition
Introduction to java micro edition
 
JavaME Development Workflow - JMDF 2007
JavaME Development Workflow - JMDF 2007JavaME Development Workflow - JMDF 2007
JavaME Development Workflow - JMDF 2007
 
J2ME mobile app development
J2ME mobile app developmentJ2ME mobile app development
J2ME mobile app development
 
J2 Me
J2 MeJ2 Me
J2 Me
 
Introduction to Mobile Application Development
Introduction to Mobile Application DevelopmentIntroduction to Mobile Application Development
Introduction to Mobile Application Development
 
Java ME CLDC MIDP
Java ME CLDC MIDPJava ME CLDC MIDP
Java ME CLDC MIDP
 
Mobile Application Development MAD J2ME
Mobile Application Development  MAD J2MEMobile Application Development  MAD J2ME
Mobile Application Development MAD J2ME
 
Session1 j2me introduction
Session1  j2me introductionSession1  j2me introduction
Session1 j2me introduction
 
2 mobile development frameworks and tools dark temp
2   mobile development frameworks and tools dark temp2   mobile development frameworks and tools dark temp
2 mobile development frameworks and tools dark temp
 
J2me step by step
J2me step by stepJ2me step by step
J2me step by step
 
Blackberry Development Environment
Blackberry Development EnvironmentBlackberry Development Environment
Blackberry Development Environment
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

J2 me 1

  • 1. Java Platform, Micro Edition (J2ME) Click to add text J2ME 1
  • 3. Introduction  Why? – To have the ability to program to day to day devices such as:  cell phones  smart cards  personal organizers , palmtops  What? – A java base platform for such customizations.  Who? Sun!!!, But also vendors like Nokia , … J2ME 3
  • 4. Java? – J2ME   Java – “write once run anywhere” But:   Different devices have different requirements. Those devices doesn’t have the same environment as regular computers (standard desktop), the constrains we have:      Limited memory and processor. Small screen sizes. Alternative input methods. One platform (solution) cannot address all the market segments (web server, video games etc.) Users/developers want flexibility. They want to choose what they want to use and what they don’t.  Sun decided to develop a special edition of Java – J2ME (Java 2 Micro Edition). J2ME 4
  • 5. Features Robust , Flexible environment , Secure built-in network protocols supports for networked .offline applications • • • • • •
  • 6. Java Editions  The Java 2 Platform is split into three editions:       Java 2 Standard Edition (J2SE) - Desktop-based applications. Java 2 Enterprise Edition (J2EE) - Server-based applications. Java 2 Micro Edition (J2ME) – For handheld and embedded devices. Each edition provides a complete environment for running Java-based applications including the Java virtual machine (VM) and runtime classes. What separates one edition from another, then, is primarily the set of class libraries that each edition defines. you can think of J2ME as a subset of J2SE and J2SE as a subset of J2EE. J2ME 6
  • 7. What will we know. J2ME 7
  • 8.
  • 9.
  • 10. Relative Features of various VMs JVM Java Spec Target Devices Processor Memory HotSpot VM J2EE Enterprise Servers Up to 64 bit Upwards of 2 MB HotSpot VM J2SE Workstations, Desktop Clients, Laptops 32-64 bit Upwards of 2MB CVM J2ME High end, consumer electronic and embedded devices like wireless communicators eg. devices running Symbian's EPOC OS), high-end PDAs (e.g. devices running embedded Linux or Windows CE), residential gateways, automotive telematic systems, set-top boxes and screen phones Cell Phones, Pagers, PDAs 32 bit 2MB – 10 MB KVM Card VM J2ME Java Card Smart Cards Min 512Kb ROM Min 256 kB RAM Relatively constrained GUI 16 bit 160-512 kB 8 bit Highly constrained GUI <32 kB
  • 11. Java platform for mobile devices and embedded systems Resource-constrained in terms of CPU, memory, energy Smallest footprint and smallest VM – • – Differentiates between different types of resource-constrained devices Some with more resources, such as set up boxes, automobile – navigation systems More constrained devices, such as cellular phones, PDAs, pagers – Architecture has four layers • JVM that sits on top of the operating system The configuration layer – The profile layer • – – Optional packages layer –
  • 12. Optional Packages Optional Packages Personal Profile Mobile Information Device Profile Foundation Profile )MIDP( Connected Device Configuration Connected Limited Device Configuration )CDC( )CLDC( Java Virtual Machine Operating System
  • 13. Optional Packages Optional Packages Personal Profile Mobile Information Device Profile Foundation Profile )MIDP( Connected Device Configuration Connected Limited Device Configuration )CDC( )CLDC( Java Virtual Machine Operating System
  • 14. Java Programming Language and VM features Floating point support Float and Double • – Calendar, Date, Timezone, and Thread objects redesigned to be more Java SE-compliant :JVM the same as the one used in Java SE, except No finalization of class instances – Method Object.finalize() not included • Exemption and error handling limitations – User-defined class loaders are not supported – Thread groups not supported; only individual threads Class file verification not supported • – Only offline preverification with stack maps • – •
  • 16. J2ME Core Concepts  At the heart of Java 2 Micro Edition (J2ME) are three core concepts: configurations, profiles, and optional packages.  You can't write a J2ME application without understanding these concepts, because they determine the features of Java that you can use, which application programming interfaces (APIs) are available, and how your applications are packaged. J2ME 16
  • 17.
  • 18. :J2ME Delivers :Two Configurations CDC – Connected Device Configuration • CLDC – Connected, Limited Device Configuration • • :Two major Profiles MIDP – Mobile Information Device Profile • Foundation Profile • Others Upcoming – PDA Profile, Personal Profile, RMI Profile, Java Game Profile, MIDP_NextGen Profile • •
  • 19. J2ME Core Concepts  Profile:  A collection of Java Classes selected from one or more Java core, extension or vertical APIs. Classes are chosen to provide a complete solution for a specific vertical market  Configuration:  A subset of the Java core APIs and Java language functionality selected to provide a minimal Java platform for a set of vertical markets J2ME Profile J2ME Libraries Java Language Java Virtual Machine Profiles Optional Packages Configuration  Host Operating System J2ME 19
  • 20. J2ME Core Concepts  Profile:  A collection of Java Classes selected from one or more Java core, extension or vertical APIs. Classes are chosen to provide a complete solution for a specific vertical market  Configuration:  A subset of the Java core APIs and Java language functionality selected to provide a minimal Java platform for a set of vertical markets J2ME Profile J2ME Libraries Java Language Java Virtual Machine Profiles Optional Packages Configuration  Host Operating System J2ME 20
  • 21. Java ME technology comprises :with three elements as Configuration • Profile • Optional package •
  • 22. What it all means  There is no "J2ME application“:  Configuration, profile and optional packages should be chosen. A configuration is a complete Java runtime environment:  Java virtual machine (VM) to execute Java.  Set of core Java runtime classes  Interface to the underlying system J2ME 22
  • 23. ME Configuration are 2 types J2ME Configuration are 2 types • Connected Limited Device. 1 • )Configuration (CLDC Connected Device Configuration. 2 • )(CDC
  • 24.
  • 25. Configurations-1: CDC CDC is based on CVM • The CVM is a full-featured, Java 2 Virtual Machine; designed for devices needing the functionality of the Java 2 .VM feature set • The CDC is a configuration that could become interesting for mobile terminals as their capabilities increase • CDC targets networked devices with relatively constrained .Graphical user Interfaces • Basic packages: java.lang, java.util, java.net, java.io, java.text, java.security •
  • 26. Configurations-2: CLDC CLDC is based on KVM • :Limitations w.r.t. J2SE • )No support for JNI (Java Native Interface Limited bytecode verifier • Limited support for internationalization • No support for object finalization • No thread groups and daemon threads • Limited error handling • Simplified sandbox security model • No certificates supported • No refection: No Serialization, RMI or JINI • • Features like Floating point support and J2ME Web Services support added in latest CLDC v1.1 •
  • 27. What it all means  The profile adds classes to a configuration: To fill in missing functionality  To support specific uses of a device   The Optional Packages are set of APIs that support additional and common behaviors.  Examples of optional packages : Bluetooth Optional Package  JDBC Optional Package  J2ME 27
  • 28. Configuration  There  The are 2 basic configurations. superset:  CDC (Connected Device Configuration): 2 MB or more memory for Java platform.  32-bit processor.  High bandwidth network connection.  full-featured Java 2 virtual machine (CVM).  17 packages.  Use for devices like Palms. J2ME 28
  • 29. CLDC is a configuration for small • devices. Connected Limited Device Configuration is designed in such a way that the devices with limited resources can run on Java platform, limited resources specifies that limited memory, processing power, and graphical .capabilities It uses KVM • :Ex: pagers, cell phones, etc •
  • 30. • 160 - 512 KB of total memory • 16-bit or 32-bit processor • Low power consumption and often operating with battery power • Connectivity with limited bandwidth • Selected classes from: • java.lang , java.io , java.util
  • 31. Handling I/O in CDC / CLDC  The CLDC has defined a new set of APIs for I/O called the Generic Connection Framework.  The GCF, part of the new javax.microedition.io package, defines interfaces for the different kinds of I/O that are possible.  Since the CDC is a superset of the CLDC, it includes the GCF.  CDC also requires GCF support for two specific connection types: files and datagrams since it includes the relevant classes from java.io and java.net packages. J2ME 32
  • 32. CDC CDC is a configuration for more capable • . devices and smart phones Connected Device Configurationis • :designed for for example smart phones, embedded device can • run on Java Platform.Minimum It uses JVM •
  • 33. Configuration - What it all means  CDC-based profiles make development simpler due to J2SE-like APIs, but don’t suit the low-end devices.  CLDC-based profiles makes the development task harder, especially when trying to shrink the size of the application to run on many of the small devices. J2ME 34
  • 34. Profile  Several profiles in various stages of development:      Mobile Information Device Profile (MIDP) - CLDC-based, used for running applications on cellphones and interactive pagers with small screens, wireless HTTP connectivity, and limited memory. Personal Digital Assistant Profile (PDAP) – CLDC-based, extends MIDP with additional classes and features for more powerful handheld devices. Foundation Profile (FP) – CDC-based, extends the CDC with additional J2SE classes. Personal Basis Profile (PBP) - extends the FP with lightweight (AWT-derived) user interface classes and a new application model. Personal Profile extends the PBP with applet support and heavyweight UI classes. J2ME 35
  • 35. • The profile consists of java classes to a configuration: • To fill in missing functionality • To support specific uses of a device
  • 36. Profile  The CLDC-profile used today: MIDP (Mobile Information Device Profile)  The MIDP defines a platform for dynamically and securely deploying optimized, graphical, networked applications.  The MIDP specification was defined through the Java Community Process (JCP) by players like: Motorola, Nokia, Ericsson, Research in Motion, and Symbian. J2ME 37
  • 37. MIDP – MID Profile  MIDP is targeted at a class of devices known as mobile information devices (MIDs).  Minimal characteristics of MIDs:  Enough memory to run MIDP applications  Display of at least 96 X 56 pixels, either monochrome or color  A keypad, keyboard, or touch screen  Two-way wireless networking capability J2ME 38
  • 38. )MIDP (Mobile Information Device Profile • The MIDP defines a platform for dynamically and securely deploying optimized, graphical, networked applications. • The MIDP specification was defined through the Java Community Process (JCP) by players like: Motorola, Nokia, Ericsson, Research in Motion, and Symbian.
  • 39. MIDP - Specification  There are two versions of the MIDP:  MIDP 1.0 - is the original specification, provides core application functionality required by mobile applications, including basic user interface and network security  MIDP 2.0 - is a revised version of the MIDP 1.0. Have new features include an enhanced user interface, multimedia and game functionality, more extensive connectivity, over-the-air provisioning, and end-to-end security. J2ME 40
  • 40. …MIDlets – The heart of J2ME  MIDP does not run in the “regular” Java fashion. using: Main() , System.exit().  Instead, we use MIDlet aplications - which are subclasses of: javax.microedition.midlet.MIDlet that is defined by MIDP.  The MIDlet class allows the application management software to: control the MIDlet  be able to retrieve properties from the application descriptor  notify and request state changes  J2ME 41
  • 41. …MIDlets – The heart of J2ME  The extending class is the main class of the application.  The MIDlet class defines abstract methods that the main class implements (for example: startApp(), destroyApp(), notifyDestroyed()). J2ME 42
  • 42. MIDlet Suite  One or more MIDlets are packaged together into a MIDlet suite, composed of: JAR (Java archive) file - The JAR file contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets. The JAR file also contains resource files used by the MIDlets and a manifest file.  JAD (Java Application Descriptor) file - This file contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets   Eventually the JAR / JAD files are upload to the machine in order to run the application. J2ME 43
  • 43. Configuration + Profile  When the Java 2 Platform, Micro Edition (J2ME) was first introduced, only one configuration, the Connected Limited Device Configuration (CLDC), and one profile, the Mobile Information Device Profile (MIDP) had been defined as formal specifications.  Today, there are nearly forty J2ME-related specifications at various stages in the JCP, and many of these specifications define optional packages instead of configurations or profiles. J2ME 44
  • 44. So what is an optional package?  An optional package is also a set of APIs, but unlike a profile, it does not define a complete application environment.  An optional package is always used in conjunction with a configuration or a profile. It extends the runtime environment to support device capabilities that are not universal enough to be defined as part of a profile or that need to be shared by different profiles.  Examples: RMI Optional Package (Remote Method Invocation).  Wireless Messaging API.  Mobile Media API  J2ME 45
  • 45. Extenders  There are some companies that created different suite for J2ME.  Those companies are “competing partners” with Sun (- they buy the KVM from Sun).  Example:  Nokia’s Developer's Suite: provides tools for creating application classes and packages, signing the application, and deploying it to a device. It is also an essential tool for managing, configuring, and running emulators for various Nokia Platform. J2ME 46
  • 46. What we know so far: J2ME 47
  • 47. summary  Java 2 Micro Edition defines a small footprint version of Java for resource constrained devices. Specifically, code space of <512K and RAM (for java heap) of 64KBytes or more.  The Connected Limited Device Configuration (CLDC) defines the minimum required complement of Java technology components and libraries for small connected devices. Java language and virtual machine features, core libraries, input/output, networking and security are the primary topics addressed by this specification.  The Mobile Information Device Profile (MIDP) defines an additional set of API’s on top of the Connected Limited Device Configuration (CLDC) for small handheld devices such as PDA’s and cellular phones. These include UI, Persistence, Networking, Timers, and Application Lifecycle. J2ME 48
  • 49. Requirements      Java2 SE SDK 1.4.x (Can be downloaded at: http://java.sun.com/j2se/1.4.2/download.html) The Eclipse IDE 3.x (Can be downloaded at: http://www.eclipse.org/downloads/index.php) A supported wireless toolkit (A List of supported toolkits can be found at: http://eclipseme.org/docs/support_wtk.html) Any kind of Emulator EclipseME 1.x.x version 1.1.0 (supports Eclipse 3.1 only)  version 1.0.1 (either Eclipse 3.0 or Eclipse 3.1 are supported)  prior 1.0.0 (support Eclipse 3.0 only)  J2ME 50
  • 50. :Minimum requirements for hardware Hard Disk 100 MB RAM 128 MB CPU 800 MHz Pentium III • • • •
  • 51. Installation      Verify J2SE SDK is installed on your system (1.4.2 and later is preferable) Verify Eclipse 3.0 or later is installed on your system Install a Wireless Toolkit  J2ME Wireless Toolkit 2.2 + Patch (Can be downloaded at: http://java.sun.com/products/sjwtoolkit/download-2_2.html )  Nokia S40 DP20 SDK 6230i 1.0 (Can be downloaded at: http://forum.nokia.com) install either integrated with J2ME WT or as Standalone Install an Emulator Install EclipseME J2ME 52
  • 52. Verify Plug In installation  If the J2ME plug-in is properly installed, there will be a J2ME entry in the Window / Preferences dialog J2ME 53
  • 53. Verify Wireless Toolkit Installed Select the Preferences menu item from Eclipse's Window menu.  Expand the J2ME item in the pane to the left and click on Platform Components.  Verify that the Wireless Toolkits appears  If not right click on the Wireless Toolkit and add the root directory.  J2ME 54
  • 54. Create New Midlet Suite  Create a new project  File -> new -> Project J2ME 55
  • 55. Project properties  Give a name to the project and Select the location on the disk J2ME 56
  • 56. Select Wireless Toolkit  Select the Wireless Toolkit you wish to work with J2ME 57
  • 57. Creating a new MIDlet  On the ToolBar Select File -> New -> Other J2ME 58
  • 58. MIDlet Properties  Select a Name for the Midlet, Superclass and implemented interfaces. J2ME 59
  • 60. Importing Packages Importing MIDP specific packages import javax.microedition.lcdui.*; import javax.microedition.midlet.*; J2ME 61
  • 61. LCDUI    The UI API provides a set of features for implementation of user interfaces for MIDP applications. The central abstraction of the MIDP's UI is a Displayable object, which encapsulates device-specific graphics rendering with user input. Only one Displayable may be visible at a time, and the user can see and interact with only contents of that Displayable. The Screen class is a subclass of Displayable that takes care of all user interaction with high-level user interface component. The Screen subclasses handle rendering, interaction, traversal, and scrolling, with only higher-level events being passed on to the application. J2ME 62
  • 62. Superclass And Interface Extends MIDlet Implements CommandListener public class TestMIDlet extends MIDlet implements CommandListener { J2ME 63
  • 63. MIDlet API  Abstracts:  protected abstract void startApp() – Signals the MIDlet that it has entered the Active state  protected abstract void pauseApp() – Signals the MIDlet to enter the Paused state  protected abstract void destroyApp(boolean arg0) Signals the MIDlet to terminate and enter the Destroyed state J2ME 64
  • 64. MIDlet API  Inherited:  Int checkPermission(String permission)  String getAppProperty(String key)  Void notifyPaused()  Boolean platformRequest(String URL)  Void resumeRequest()  Void notifyDestroyed() - Used by an MIDlet to notify the application management software that it has entered into the Destroyed state. J2ME 65
  • 65. CommandListener API  This interface is used by applications which need to receive high-level events from the implementation.  public void commandAction(Command c, Displayable d) - Indicates that a command event has occurred on Displayable d J2ME 66
  • 66. The MIDlet content Creating the form, adding the Commands public TestMIDlet() { mMainForm = new Form(“Ahalan"); mMainForm.append(new StringItem(null, “First Message")); mMainForm.addCommand(new Command("Exit", Command.EXIT, 0)); mMainForm.setCommandListener(this); } J2ME 67
  • 67. Form class A Form is a Screen that contains an arbitrary mixture of items: images, read-only text fields, editable text fields, editable date fields, gauges, choice groups, and custom items.  In general, any subclass of the Item class may be contained within a form.  The implementation handles layout, traversal, and scrolling. J2ME 68
  • 68. Form and Item classes J2ME 69
  • 69. Test your code  Choose the target platform  Choose the desired Device (Emulator)  Run J2ME 70
  • 71. Distribution to actual devices  Create a package  Place your code somewhere on the net.  Update .jad file  Download the application to your mobile  Run the application J2ME 72
  • 73. The SMS server  We have build a MIDlet that acts as an SMS server.  The MIDlet listens to incoming SMS events. If the SMS matches a predefined pattern, it is processed as a command.  We have defined a few sample commands:     Add a contact to the device’s phonebook Flash the backlights Turn on vibrating mode Many more option can be added. For example:  A command that will order the phone to take a snapshot using it’s built-in camera J2ME 74
  • 74. Nokia Connectivity Framework     Nokia Connectivity Framework (NCF) is a tool, which manages, configures and integrates products so that they can communicate with each other and with exterior integratable hardware or software. NCF provides an integration platform for delivering content data in mobile development environment between the connected external software components. For example, phone emulators, content development tools, software development tools, real time server emulators and server emulators. With the aid of NCF a user can construct, maintain, modify and use development environments that support different technologies, formats, and versions. J2ME 75
  • 75. Nokia Connectivity Framework  We will use the framework to display a demonstration of the SMS server MIDlet.  We will use the framework to simulate two phones and the two-way communication between them. J2ME 76

Editor's Notes

  1. Stat with: Who doesn’t own a cellphone? Say that it is different than anything we knew until today.
  2. It defines interfaces and a factory class for creating objects that implement those interfaces.
  3. Virtual Machine is nothing but the Configurations.
  4. It defines interfaces and a factory class for creating objects that implement those interfaces.
  5. Almost any wireless device built these days fits the definition of a MID, including low-end cellphones. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices specifically: PDAs have more memory, larger screens, and interesting information management capabilities that are more effectively exploited using other profiles.
  6. Almost any wireless device built these days fits the definition of a MID, including low-end cellphones. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices specifically: PDAs have more memory, larger screens, and interesting information management capabilities that are more effectively exploited using other profiles.
  7. Almost any wireless device built these days fits the definition of a MID, including low-end cellphones. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices. Personal digital assistants (PDAs) can also be considered to be MIDs because wireless networking is now an option for most PDAs, but MIDP doesn&apos;t target these devices specifically: PDAs have more memory, larger screens, and interesting information management capabilities that are more effectively exploited using other profiles.
  8. The MIDP 1.0 specification was defined by an expert group consisting of all the major players in the wireless and handheld device arena, including familiar names like Motorola, Nokia, Ericsson, Research in Motion, and Symbian. It has a lot of support in the telecommunications industry, and handset manufacturers like Motorola and Nokia in particular are devoting a lot of development effort to supporting MIDP in a wide range of their devices.
  9. The first concept we have to understand is the MIDlet
  10. A Java Application Descriptor (JAD) file. This file contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets. A Java Archive (JAR) file. The JAR file contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets. The JAR file also contains resource files used by the MIDlets and a manifest file.
  11. A Java Application Descriptor (JAD) file. This file contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets. A Java Archive (JAR) file. The JAR file contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets. The JAR file also contains resource files used by the MIDlets and a manifest file.
  12. A Java Application Descriptor (JAD) file. This file contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets. A Java Archive (JAR) file. The JAR file contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets. The JAR file also contains resource files used by the MIDlets and a manifest file.
  13. A Java Application Descriptor (JAD) file. This file contains a predefined set of attributes that allows the device application management software to identify, retrieve, and install the MIDlets. A Java Archive (JAR) file. The JAR file contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets. The JAR file also contains resource files used by the MIDlets and a manifest file.
  14. It defines interfaces and a factory class for creating objects that implement those interfaces.
  15. There’s sun’s download center Choose the relevant operating system. Available for windows, linux, solaris. (not for OS X, although MIDP is available). You need java sdk 1.3 or higher Install the toolkit in a directory with no space in its name…
  16. KToolbar is the main working tool to handle J2ME applications You can create a new project, open an existing one, choose the emulator device, change the settings, build (compile and preverify) and run the simulation.
  17. KToolbar is the main working tool to handle J2ME applications You can create a new project, open an existing one, choose the emulator device, change the settings, build (compile and preverify) and run the simulation.
  18. When creating a new project, you have to give it a name ( the name of the project will be the name of the directory under apps), and give the name of the MIDlet class.
  19. When creating a new project, you have to give it a name ( the name of the project will be the name of the directory under apps), and give the name of the MIDlet class.
  20. CommandListener – attaching the listener to the entire screen, the command can be of type SCREEN or anything else…
  21. S
  22. Target setting - The project settings information and tabs change based on the selection you choose for the target platform. Some project settings are not applicable for a selected target platform. Building using the KToolbar – creating the classes and the .jad file Preverify – makes sure that the .jad is updated with the .jar files. That the used classes in the application are available in the chosen target platform. Doing so allows the device using the application without further checking which require more memory and cpu. Run – with the emulator, from the KToolbar
  23. Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices. This process entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest. Again, these chores are best left to the J2ME Wireless Toolkit. To bundle up your MIDlet suite, select Project | Package from the menu. The .jad and .jar files for the MIDlet suite will be generated and placed in the bin directory of the project. The .jad file should contain the correct address of where the files are located on the net.
  24. Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices. This process entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest. Again, these chores are best left to the J2ME Wireless Toolkit. To bundle up your MIDlet suite, select Project | Package from the menu. The .jad and .jar files for the MIDlet suite will be generated and placed in the bin directory of the project. The .jad file should contain the correct address of where the files are located on the net.
  25. Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices. This process entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest. Again, these chores are best left to the J2ME Wireless Toolkit. To bundle up your MIDlet suite, select Project | Package from the menu. The .jad and .jar files for the MIDlet suite will be generated and placed in the bin directory of the project. The .jad file should contain the correct address of where the files are located on the net.
  26. Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices. This process entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest. Again, these chores are best left to the J2ME Wireless Toolkit. To bundle up your MIDlet suite, select Project | Package from the menu. The .jad and .jar files for the MIDlet suite will be generated and placed in the bin directory of the project. The .jad file should contain the correct address of where the files are located on the net.