0% found this document useful (0 votes)
82 views32 pages

Personalized and Intelligent Information Appliances Are Necessities in Our Life Today. Such Appliances Can Be

Uploaded by

nikh4ever
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views32 pages

Personalized and Intelligent Information Appliances Are Necessities in Our Life Today. Such Appliances Can Be

Uploaded by

nikh4ever
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 32

Introduction

 Personalized and intelligent information appliances


are necessities in our life today.
 Such appliances can be:
 cell phones
 two-way pagers
 smart cards
 personal organizers
 palmtops
 These appliances tend to be special-purpose,
limited-resource, network-connected devices.

J2ME 1
Environment requirements
 We need an environment which is adapted for
constrained devices - devices that have
limitations on what they can do when
compared to standard desktop or server
computers.
 The constraints are:
 extremely limited memory
 small screen sizes
 alternative input methods
 slow processors

J2ME 2
Java Editions
 Different devices have different
requirements and different expectations
of Java.
 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 do not.

J2ME 3
Java Editions
 The Java 2 Platform is split into three
editions.
 Each edition provides a complete
environment for running Java-based
applications, including the Java virtual
machine (VM) and runtime classes.
 The three editions target different kinds
of applications running on different kinds
of devices.

J2ME 4
Java Editions

Java 2 Platform

Java2 Java2 Java2


Standard Edition Enterprise Edition Micro Edition
(J2SE™) (J2EE™) (J2ME™)

Standard desktop & Heavy duty server Small & memory


workstation applications systems constrained devices

J2ME 5
Java Editions
 Each edition defines different sets of class
libraries.
 There are thousands of core J2SE runtime
classes, taking up to 10-20 megabytes
of space.
J2EE
 J2ME-based devices have
fewer classes. J2SE

J2ME

J2ME 6
J2ME Core Concepts
 Configuration

Profiles
J2ME
 Minimum platform Profile
required for a
group of devices
J2ME
 Profile Libraries

Configuration
 Addresses specific Java Language
needs of a certain
device family Java Virtual Machine

 Optional Packages
Host Operating System

J2ME 7
J2ME Core Concepts

J2ME is based on 3 core concepts:


 Configurations
 Profiles
 Optional packages

J2ME 8
Configurations

 A configuration is a complete Java


runtime environment, consisting of:
 Java virtual machine (VM) to execute Java
bytecode
 Native code to interface to the underlying
system
 Set of core Java runtime classes

 To use a configuration, a device must


meet certain minimum requirements.
J2ME 9
Configurations

 The set of core classes is normally quite


small and must be enhanced with
additional classes supplied by J2ME
profiles or by configuration implementor.
 Configurations do not define any user
interface classes.

J2ME 10
Configurations

Configuration
Configuration

CLDC
CLDC CDC
CDC

Connected Limited Connected Device


Device Configuration Configuration

J2ME 11
CLDC vs. CDC
 CLDC  CDC
 For very constrained  2 MB or more
devices memory for Java
 160 - 512 KB of total
platform
memory  32-bit processor
 16-bit or 32-bit
 High bandwidth
processor
 Low power network connection,
consumption and most often using
often operating with TCP/IP
battery power
 Connectivity with
limited bandwidth
J2ME 12
CLDC vs. CDC - VM
 Features missing in  The CDC supports a
the CLDC VM: complete, full-
featured Java 2
 Floating point types virtual machine
 Object finalization
 JNI or reflection
 Thread groups or
daemon threads
 User Class loaders
 Change in classfile
verification  preverification
J2ME 13
The KVM and CVM
 KVM - Java virtual machines for the CLDC
 CVM - Java virtual machines for the CDC
 Written specifically to work in the constrained
environment of a handheld or embedded
device and to be easily ported to different
platforms.
 CLDC and CDC specifications do not require
the use of the KVM or the CVM.

J2ME 14
CLDC vs. CDC – J2SE Subset
 The CLDC includes  The CDC includes
classes from: 17 packages
 java.lang  Includes more
 java.io classes even in the
 java.util shared packages
 Only selected
classes from each
package are
included

J2ME 15
CLDC vs. CDC – J2SE Subset

J2SE CDC CLDC

J2ME 16
Handling I/O
 J2SE includes many classes for
performing input and output.
 There are a large number of I/O classes
and they tend to encapsulate I/O models
that are not necessarily found on all
devices.
 For example, some handheld devices do
not have file systems. Socket support is
not universal, either.

J2ME 17
Handling I/O in CLDC
 The CLDC has define 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.
 The CLDC does not actually define any I/O
implementations these are left to the profiles
and/or the device vendor to define.

J2ME 18
GCF - example
import java.io.*;
import javax.microedition.io.*;

StreamConnection conn = null;


InputStream is = null;
String url = "socket://somewhere.com:8909";

try {
conn = (StreamConnection) Connector.open( url );
is = conn.openInputStream();
.... // etc. etc.
}…
J2ME 19
Handling I/O in CDC

 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.
 The reason: CDC includes the relevant
classes from java.io and java.net
packages.

J2ME 20
J2ME Core Concepts

J2ME is based on 3 core concepts:


 Configurations
 Profiles
 Optional packages

J2ME 21
Profiles
 Adds domain-specific classes to a
configuration:
 To fill in missing functionality
 To support specific uses of a device
 Most profiles define user interface classes for
building interactive applications.
 To use a profile, the device must meet the
minimum requirements of the underlying
configuration and of the profile.

J2ME 22
Profiles

Profile
Profile

MIDP
MIDP PDAP
PDAP FP
FP PBP
PBP PP
PP

Mobile Personal Foundation Personal Personal


Information Digital Profile Basis Profile Profile
Device Assistant
Profile Profile

J2ME 23
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 24
MIDP - Specification

 There are two versions of the MIDP:


 MIDP 1.0 - released in September
2000. Many devices currently on the
market support it.
 MIDP 2.0 - currently in proposed final
draft form. No devices yet support it.

J2ME 25
MIDP - Specification
 The MIDP adds APIs to the basic APIs defined
by the CLDC. The new features include:
 Support for application lifecycle management
similar to the way applets are defined in J2SE.
 Persistent storage of data.
 HTTP-based network connectivity based on the
CLDC's GCF.
 Simple user interface support, with enough
flexibility to build games or business applications.

J2ME 26
MIDP - Specification

 The MIDP specification is silent about a


number of things:
 No standard way to interface to the device's
phonebook, in order to initiate voice calls.
 How MIDP applications are loaded onto a
device and how they are activated or
deactivated.

J2ME 27
MIDP Applications restrictions
 Memory is a particularly scarce resource.
 The early Motorola J2ME-enabled phones limited
the size of an application to 50K. Some Nokia
phones limit them to even less, about 30K.
 MIDP 1.0 applications cannot share classes.
 Placing part of the application in a web or
application server (as a servlet, typically) that
the MIDP application calls is almost a
requirement for anything serious.

J2ME 28
J2ME Core Concepts

J2ME is based on 3 core concepts:


 Configurations
 Profiles
 Optional packages

J2ME 29
Optional Packages
 Set of APIs in support of additional,
common behaviors.
 Have specific dependencies on a
particular configuration and/or one or
more profiles.
 Examples of optional packages :
 RMI Optional Package
 Bluetooth Optional Package

 JDBC Optional Package

J2ME 30
What it all means
 "J2ME application" is an ambiguous term.
 Configuration, profile and optional packages
should be chosen.
 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 31
!The END
 You can download all the demos
JARs from:
www.cs.huji.ac.il/~kerengaz/j2me/

 Have Fun!!!

J2ME 32

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy