J2ME -Kushal Modi(09BIT056).

Slides:



Advertisements
Similar presentations
MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
Advertisements

Pengantar Teknologi Mobile 12
Introduction of J2ME Mobile solutions. Overview What is J2ME. How does J2ME work? Java J2ME Carriers and Products. The Two Configuration of J2ME. Profiles.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Multimedia Network Communications Subject:T0934 / Multimedia Programming Foundation Session:13 Tahun:2009 Versi:1/0.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Writing Your First MIDlet Running JAVA on a Cell Phone Jon A. Batcheller January 27, 2004.
UNDERSTANDING JAVA APIS FOR MOBILE DEVICES v0.01.
Introduction to Java 2 Micro Edition Mark Balbes, Ph.D. Senior Software Engineer Jeff Brown Senior Software Engineer.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 10 Java for MIDs Rob Pooley
Developing an Application with J2ME Technology Scott Palmer, Nat Panchee, Judy Sullivan, Karen Thabet, Sten Westgard.
JAVA Technology. Java Technology Java technology is a portfolio of products that are based on the power of networks and the idea that the same software.
© 2009 Research In Motion Limited Advanced Java Application Development for the BlackBerry Smartphone Trainer name Date.
J2ME for Palm Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke.
Introduction to Mobility Java Technology Mobile and Wireless Networks.
Developing Software for Wireless Devices
J2ME Prepared by: - Gaery- Ronny - Alan- Andy. Why Technology for Mobile Devices? The nature of wireless devices is changing Old devices: All the software.
PDA Programming Using J2ME Presenter :涂俊凱 Date : 2003/4/8.
Making Cell Phone Games An Overview Ray Ratelis Guild Software, Inc.
V0.01 © 2009 Research In Motion Limited Understanding Java APIs for Mobile Devices Trainer name Date.
Developing J2ME Applications Mobile and Wireless Networks.
The 21th century Repairman Agenda Introduction J2EE J2ME Demonstration.
Cosc 4730 Phone Programming in Java An Introduction.
Java Platform, Micro Edition (J2ME)
J2EE Java 2 Enterprise Edition. Relevant Topics in The Java Tutorial Topic Web Page JDBC orial/jdbc
Java 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
L EC. 01: J AVA FUNDAMENTALS Fall Java Programming.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
LESSON 1 INTRODUCTION Compiled By: Edwin O. Okech [Tutor, Amoud University] JAVA PROGRAMMING.
Topics on KVM Presented By Xiaozhou David Zhu. Topics covered Introduction Java2 Platform Micro Edition CLDC KVM.
Android Introduction Platform Overview.
EclipseME Java Micro Edition The Eclipse Way Craig Setera April 19, 2006.
J2ME Java for Mobile Environments Based on J2ME In A Nutshell, by Kim Topley, O’Reilly & Associates Inc., 2002, and Tetris by Alexei Patinov.
Platforms and tools for Web Services and Mobile Applications J2ME based Applications Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Project By:. 2 Agenda Introduction Problem Definition Proposed Solution Block Diagram Flowchart Technical Implementation Hardware & Software Requirements.
Getting Started with JXTA for J2ME Advisor : Dr. Ching-Long Yeh Report : DI.2, 洪泰昌 ( ) Course: XML 文件管理.
Michael Brockway Advanced Applications Development in Java J2ME -- Introduction l Introduction / Overview l Java 2 Micro Edition n CLDC n MIDP l Examples.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 11 J2ME and MIDlets Rob Pooley
Small Devices on DBGlobe System George Samaras Chara Skouteli.
Framework and application bytecode size CLDC MIDP kXML parser Utility classes Graphics Logic (MIDlet) Application Data (XML file)
ANDROID Presented By Mastan Vali.SK. © artesis 2008 | 2 1. Introduction 2. Platform 3. Software development 4. Advantages Main topics.
Computer Science Wi-Fi App using J2ME and MVC Architecture Advisor : Dr. Chung-E Wang Department of Computer Science Sacramento State University Date:
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
Java 2 Micro Edition (J2ME) and the world of java
1Basics of J2ME. 2 Objectives –Understand the different java API’s and how the mobile edition API’s fit in –Understand what a mobile configuration and.
Introduction to Java Programming with Forte Y. Daniel Liang.
Session 1 Introduction to Java. Objectives Java Simplified / Session 1 / 2 of 32 Explain the history of Java Explain Java in brief List the types of Java.
Java 2 Micro Edition The Connected, Limited Device Configuration.
Java 2 Platform, Micro Edition (J2ME)
1 Introduction to J2ME Outline MIDP Building J2ME Apps- Tool J2ME Wireless Toolkit Demo MIDlet Programming -- MIDlet Transition States -- Midlet Skeleton.
Mobile Programming Mobile Programming - Ordibehesht Ordibehesht 1390.
Introduction to Programming 1 1 2Introduction to Java.
Enhanced mobile services in Java enabled phones Björn Hjelt Sonera zed ltd Supervisor: Professor Jorma Jormakka.
Introduction to JAVA Programming
 This work confers an application which makes possible to use a Bluetooth enabled mobile phone to remote control home appliances such electric fan, LEDs.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Visual Mobile Applications with Netbeans 6.0 Your Name Sun Campus Ambassador Your Address.
Visual Mobile Gaming Your Name Sun Campus Ambassador Your Address.
The Java Platform Micro Edition Java ME
Java N Amanquah.
Part II Software When developing software there are several particularities to be aware of: Java is widespread used because of the platform independence.
Programming of Handheld and Mobile Devices
MOBILE DEVICE OPERATING SYSTEM
Wireless Instant Messaging Using J2ME
By Jeff Heaton An Overview of J2ME By Jeff Heaton
Introduction of J2ME Mobile solutions.
Java for Mobile Devices
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

J2ME -Kushal Modi(09BIT056)

Content Three main Java environments Introduction of J2ME Java 2 Micro Edition Configurations and profiles Optional packages

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 (JVM) 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.

Introduction Java Platform, Micro Edition or Java ME, is a Java Platform designed for Embedded System(Mobile Device). Target Devices range from industrial controls to mobile phones and set-top boxes. Java ME was designed by Sun Microsystem, acquired by Oracle Corporation in 2010; the platform replaced a similar technology, PersonalJava. Originally developed under the Java Community Process as JSR 68, the different flavors of Java ME have evolved in separate JSRs.

Java ME devices implement a profile Java ME devices implement a profile. The most common of these are the Mobile Information Device Profile aimed at mobile devices, such as cell phones, and the Personal Profile aimed at consumer products and embedded devices like set-top boxes and PDAs. Profiles are subsets of configurations, of which there are currently two: the Connected Limited Device Configuration (CLDC) and the Connected Device Configuration (CDC). There are more than 2.1 billion Java ME enabled mobile phones and PDAs. Although it not used on some of today's newest mobile platforms (e.g. iPhone, Windows Phone 7, BlackBerry 10, Android), it continues to be very popular in sub $200 devices such as Nokia's Series 40. It is also used on new Bada operating system and on Symbian OS along with native software. As of 9th January 2012 Java ME enjoys the second position in mobile OS, ahead of Android as per netmarketshare.com ‎

Configuration 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 Defines a minimum platform for a horizontal category or grouping of devices with similar requirements on memory and processing power A J2ME application is written for a particular profile and a profile is based upon or extends a particular configuration.

Configuration There are 2 basic configurations: CDC (Connected Device Configuration) CLDC (Connected Limited Device Configuration)

Connected Device Configuration The Connected Device Configuration is a subset of Java SE, containing almost all the libraries that are not GUI related. It is richer than CLDC. CDC is used for high-end consumer devices (TV set-top boxes, Internet TV) Requirements 512KB of read-only-memory (ROM), 256 KB of random access memory (RAM), minimum 32-bit processor High bandwidth network connection Full-featured Java2 virtual machine (CVM) 17 packages

Connected Limited Device Configuration The Connected Limited Device Configuration (CLDC) contains a strict subset of the Java-class libraries, and is the minimum amount needed for a Java virtual machine to operate. A configuration provides the most basic set of libraries and virtual-machine features that must be present in each implementation of a J2ME environment. When coupled with one or more profiles, the Connected Limited Device Configuration gives developers a solid Java platform for creating applications for consumer and embedded devices. The configuration is designed for devices with 160KB to 512KB total memory, which has a minimum of 160KB of ROM and 32KB of RAM available for the Java platform.

CLDC (cont…) CLDC (Connected Limited Device Configuration) is used for low-end consumer devices - cell phones, two-way pagers, personal digital assistants (PDAs), organizers, home appliances, and point of sale terminals. Requirements 160 - 512 KB of total memory (160KB ROM and 32KB RAM,minimum) 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 Limited VM (called KVM) without: Floating point types (in CLDC 1.0) Object finalization JNI (Java Native Interface) or reflection Thread groups or daemon threads User Class loaders

Profiles The profile adds classes to a configuration: To fill in missing functionality To support specific uses of a device To address the specific demands of a vertical market sector, e.g., cellular telephones, washing machines, electronic toys The only one in existence is MIDP (cell phones)

Several profiles in various stages of development: Mobile Information Device Profile (MIDP) – CLDC based,used for running applications on cell phones and interactive pagers with small screens, wireless HTTP connectivity, and limited memory. Designed for mobile phones, the Mobile Information Device Profile includes a GUI, and a data storage API, and MIDP 2.0 includes a basic 2D gaming API. Applications written for this profile are called MIDlets. Almost all new cell phones come with a MIDP implementation, and it is now the de facto standard for downloadable cell phone games. However, many cellphones can run only those MIDlets that have been approved by the carrier, especially in North America.

Personal Digital Assistant Profile (PDAP) – CLDCbased, extends MIDP with additional classes and features for more powerful handheld devices (uses a subset of Abstract Windowing Toolkit AWT) Foundation Profile (FP) – CDC-based, extends the CDC with additional J2SE classes (devices) The Foundation Profile is a Java ME Connected Device Configuration (CDC) profile. This profile is intended to be used by devices requiring a complete implementation of the Java virtual machine up to and including the entire Java Platform, Standard Edition API. Typical implementations will use some subset of that API set depending on the additional profiles supported. Personal Basis Profile (PBP) - extends the FP with lightweight (AWT-derived) user interface classes and a new application model.

Information Module Profile Personal Profile extends the PBP with applet support and heavyweight UI classes. Information Module Profile The Information Module Profile (IMP) is a profile for embedded, "headless" devices such as vending machines, industrial embedded applications, security systems, and similar devices with either simple or no display and with some limited network connectivity. Originally introduced by Siemens Mobile and Nokia as JSR-195, IMP 1.0 is a strict subset of MIDP 1.0 except that it doesn't include user interface APIs — in other words, it doesn't include support for the Java package javax.microedition.lcdui. JSR-228, also known as IMP-NG, is IMP's next generation that is based on MIDP 2.0, leveraging MIDP 2.0's new security and networking types and APIs, and other APIs such as PushRegistry and platformRequest(), but again it doesn't include UI APIs, nor the game.

Optional Packages The Optional Packages are set of APIs that support additional and common behaviors Examples of optional packages: Bluetooth Optional Package JDBC Optional Package File connection Personal Information Management (PIM)

Optional Packages for the Wireless Market JSR 120: Wireless Messaging API JSR 135: Mobile media API JSR 172: J2ME Web Services Specification (want to try?) JSR 177: Security and Trust Services Specification JSR 179: Location API for J2ME (many students used that last year) JSR 180: Session initiation Protocol (SIP) for J2ME JSR 184: Mobile 3D Graphics for J2ME JSR 190: Event Tracking API for J2ME – monitoring and tracking MIDlets

Hardware Requirements: MIDP Memory: 256Kb non-volatile for MIDP components (in addition to the requirements of CLDC), 8Kb non-volatile for application created persistent data, 128 Kb volatile for virtual machine run time Display: 96x54, depth 1-bit, pixel shape 1:1 Input: one or two-handed keypad, touch screen Networking: two-way, intermittent, with limited bandwidth Sound: play tones.

Software Requirements: MIDP Minimal kernel to manage the underlying hardware (interrupts, exceptions, and minimal scheduling) Mechanism for reading and writing from nonvolatile memory (to support persistence API) Read and write access to devices' wireless networking (to support networking API) A mechanism to time-stamping the records written in the persistence storage Support to write a bit-mapped graphic display Mechanism to capture user input from keypad or touch screen.

CLDC 1.1 and MIDP 2.0 packages CLDC 1.1 MIDP 2.0 java.lang java.lang.ref java.io java.util javax.microedition.io MIDP 2.0 javax.microedition.lcdui javax.microedition.lcdui.game javax.microedition.media javax.microedition.media.control javax.microedition.midlet javax.microedition.pki javax.microedition.rms

Devices Evolution (Nokia) 6600 (2003) N70 (2005) M MIDP 2.0 CLDC 1.0 Bluetooth API (JSR-82 No OBEX) Mobile Media API (JSR-135) Nokia UI API Wireless Messaging API (JSR-120) MIDP 2.0 CLDC 1.1 Advanced Multimedia Supplements (JSR-234) Bluetooth API (JSR-82) FileConnection and PIM API (JSR- 75) JTWI (JSR-185) Location API (JSR-179) Mobile 3D Graphics API (JSR- 184) Mobile Media API (JSR-135) Nokia UI API Scalable 2D Vector Graphics API (JSR-226) Security and Trust Services API (JSR-177) SIP API (JSR-180) Web Services API (JSR-172) Wireless Messaging API (JSR- 205) MIDP 2.0 CLDC 1.1 Bluetooth API (JSR-82) FileConnection and PIM API (JSR-75) JTWI (JSR-185) Mobile 3D Graphics API (JSR-184) Mobile Media API (JSR-135) Nokia UI API Web Services API (JSR-172) Wireless Messaging API (JSR-120)

MIDlets – The heart of J2ME MIDP does not run in the “regular” Java fashion using: main(), System.exit() Instead, we use MIDlet applications - which are subclasses of javax.microedition.midlet.MIDlet The application must extend this class to allow the application management software to control the MIDlet: control the MIDlet installation be able to retrieve properties from the application descriptor respond to a request for state change MIDlets are installed moving its class files to a device The class files are packaged in a Java Archive (JAR), and an accompanying descriptor file (.jad extension) describes the contents of the JAR.

MIDP Application Lifecycle MIDlets move from state to state in the lifecycle – it is the application manager that changes its state: Pause After the constructor is called or, pauseApp() called by AM or, The midlet has called a notifyPaused() Active The AM has called startApp() The midlet has called resumeRequest() Destroyed The AM has called destroyApp() The midlet has called notifyDestroyed().

MIDlet Suite One or more MIDlets are packaged together into a MIDlet suite, composed of: JAR (Java archive) file Contains Java classes for each MIDlet in the suite and Java classes that are shared between MIDlets Contains resource files (e.g. an image) used by the MIDlets and a manifest file JAD (Java Application Descriptor) 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 uploaded to the device in order to run the application.

Java ME MIDP Development Requirements NetBeans IDE with Java ME Version 6.9 or later Java Development Kit (JDK) Version 6 or 7 The Windows distribution of NetBeans 6.7 and later comes bundles with the Java ME SDK 3.0. Creating a MIDP Application Using the Visual Mobile Designer The NetBeans IDE provides a wizard that enables you to quickly create a MIDP project. When creating the project, you can choose to develop your application in the Visual Mobile Designer (VMD) or in the Source Code Editor. Using the VMD gives you the ability to visually plan out the flow of the application and design the screens the application uses. The designer automatically creates the code for the application as changes are saved on the design canvas. Editing the Java Source Code Compiling and Running the Project

1) Build What happens when you press the Build button? The toolkit finds all the .java files in the src directory of your project and 1) compiles them Source files must be compiled in a MIDP environment rather than a J2SE 5.0 environment For instance a MIDlet that uses the java.lang.System class: this class has different APIs in J2SE 5.0 and MIDP When the toolkit compiles your MIDlet class it uses the MIDP java.lang.System, not J2SE 5.0 version of the class You could make this selection yourself (if you installed the MIDP reference implementation), using the command javac and the -bootclasspath option javac –bootclasspath hellomidlet.java

2) Preverifying Class Files The toolkit performs an initial verification at build time (preverifying) Certain checks are performed and the class file is modified in such a way that the second-step (runtime) can be easily handled The device's runtime system performs a second verification when it loads the classes If a class file has not preverified it is rejected You could perform the first verification yourself using the command line preverify tool.

3) JARing Finally, MIDlets are bundled into MIDlet suites for distribution to actual devices 3) package Bundling entails JARing the MIDlet suite class files and the resource files, and putting some extra information in the JAR manifest Finally the files are 4) deployed on the device The above steps are not required for running the application in the Wireless Toolkit But are required if you want to deploy the MIDlet suit on a mobile device

Deploying MIDlets MIDlets can be deployed on a phone in two ways: Transfer the jar and jad files to the phone from the computer via an external connection: serial cable, USB cable, IRDA, Bluetooth Over the Air (OTA) provisioning: download the midlet suite from a server Installation is specific to the device! Check the documentation of your device to see how to install a MIDlet suite More on these topics in the LABS!

Manifest Information Every JAR includes a manifest file METAINF\ MANIFEST.MF MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet MIDlet-2: HitMIDlet, , HitMIDlet MIDlet-Name: Hellosuite MIDlet-Vendor: Unknown MIDlet-Version: 1.0 MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0 It describes the content of the archive It may contain extra information that is important to the MIDP runtime environment (e.g. a URL to connect).

MIDlet Suite Descriptor Before a midlet can be deployed an additional file is required: an application description, a .jad file The .jad file contains a lot of the same information that’s in the manifest file The application descriptors contains information that help the device and/or the user to decide whether or not to load a MIDlet suite It can be downloaded and examined before downloading the .jar Useful in OTA provisioning – the server returned MIME type for the .jad file must be text/vdn.sun.j2me.app-descriptor

Hellosuite.jad HitMIDlet.URL: http://localhost:8080/midp/hits MIDlet-1: Hellosuite, Hellosuite.png, HelloMIDlet MIDlet-2: HitMIDlet, , HitMIDlet MIDlet-Jar-Size: 3016 MIDlet-Jar-URL: Hellosuite.jar MIDlet-Name: Hellosuite MIDlet-Vendor: Unknown MIDlet-Version: 1.0 MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0

MIDlet Properties Attributes that have meaning in a MIDlet can be added to the manifest and/or the application descriptor files It is more convenient to add an attribute to the application descriptor – it may be changed without touching the application files If an attribute is listed in both files the value in the application descriptor will be used A MIDlet can retrieve the values of these attributes using getAppProperty() Example: HitMIDlet.URL: http://localhost:8080/midp/hits in the Hellosuite.jad String url = getAppProperty(“HitMIDlet.URL”) // in the code

DEMO APPLICATION

Refernces Web site : en.wikipedia.com Book : The Complete Reference J2ME by James Keoge

Thank you