Java 2 Micro Edition Mano Chen Senior Technical Consultant

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

MIDP Mobile Information Device Profile Johnny Yau CIS 642 Prof. Insup Lee.
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.
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.
The road to reliable, autonomous distributed systems
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.
J2ME RMI 1 Java 2 Platform, Micro Edition Implementation of J2ME RMI Application Farooq Sheikh.
Interactive Visual System By Arthur Evans, John Sikorski, and Patricia Thomas.
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.
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 2 Platform, Micro Edition (J2ME) By Xiaorong Wang.
SM3121 Software Technology Mark Green School of Creative Media.
J2ME and WAP Technologies CSCI – Independent Study Fall 2002 Presented by: Kashif Syed.
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.
Understanding and Managing WebSphere V5
Java Pet Store Application. Outline Introduction Introduction Information Layer Information Layer Application Layer Application Layer Infrastructure Layer.
INTRODUCING THE JAVA EE PLATFORM Ch-5. Introduction Java is a  platform-independent programming language  secure and robust applications  may run on.
Topics on KVM Presented By Xiaozhou David Zhu. Topics covered Introduction Java2 Platform Micro Edition CLDC KVM.
Android Introduction Platform Overview.
J2ME Java for Mobile Environments Based on J2ME In A Nutshell, by Kim Topley, O’Reilly & Associates Inc., 2002, and Tetris by Alexei Patinov.
An Introduction to the Java ME Project Jens A Andersson.
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.
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
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
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)
Computer Science Wi-Fi App using J2ME and MVC Architecture Advisor : Dr. Chung-E Wang Department of Computer Science Sacramento State University Date:
第十四章 J2EE 入门 Introduction What is J2EE ?
J2EE Structure & Definitions Catie Welsh CSE 432
Enterprise Java v120131Intro to JavaEE1 Java EE 5 TM Introduction.
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
Copyright, 1996 © Dale Carnegie & Associates, Inc. Presented by Hsiuling Hsieh Christine Liu.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
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.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
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.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Mobile Programming Mobile Programming - Ordibehesht Ordibehesht 1390.
Enhanced mobile services in Java enabled phones Björn Hjelt Sonera zed ltd Supervisor: Professor Jorma Jormakka.
Introduction to JAVA Programming
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.
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
Introduction to J2EE Architecture
By Jeff Heaton An Overview of J2ME By Jeff Heaton
Distributed System Using Java 2 Enterprise Edition (J2EE)
Introduction of J2ME Mobile solutions.
Presentation transcript:

Java 2 Micro Edition Mano Chen Senior Technical Consultant Sun Microsystems Mano@sun.com

Computing Is Becoming Ubiquitous Mainframe era One computer, many users PC era One computer, one user Consumer era One user, many computers, and these computers are networked

A Game What am I? I have the following: CPU some memory screen keyboard networked runs applications

Meet Your New Computers

Agenda Overview of J2ME Developing J2ME Application

Agenda Overview of J2ME Developing J2ME Application

Problems No software market !!! Everything is proprietary Hardware, software and tools Handsets are useless without a network No compelling content

J2ME is the Solution Designed for small devices Online and offline activities Rich user and network interaction models Fully programmable Portable

Where Does J2ME Fit In?

J2ME Configurations and Profiles Java HotSpot ™ Java Virtual Machine (JVM) Card VM Java Programming Language Java 2 Enterprise Edition (J2EE) Core APIs Standard (J2SE) Java 2 Micro Edition Core APIs Personal Profile RMI Other CDC Profiles ... Foundation Mobile Information Device Profile Optional Packages Java™ 2 Platform, Micro Edition (J2ME™) encompasses VMs and core APIs specified via Configurations as well as vertical— or market-specific—APIs specified in Profiles KVM Java Card APIs

What Is a Configuration? Defines the minimum capabilities and libraries for a JVM that will be available on all devices belonging to the same “horizontal” family of devices Similar requirements in memory size and processing capabilities Subject to compatibility test Two configuration defined Connected, Limited Device Configuration Connected Device Configuration

Connected Limited Device Configuration Targeted at devices with 160KB to 512KB total memory available for Java™ technology Slow processor Limited power (often battery) Limited, perhaps intermittent connectivity to a network (often wireless) Extremely constrained UIs, small screens CLDC 1.0 specification available for free download now Sun provides CLDC reference implementation built using the KVM

What Is a Profile? A collection of Java technology-based APIs that supplement a Configuration to provide capabilities for a specific “vertical” market or device type Adds features that are specific to a certain device category such as cell phones or PDAs One profile defined Mobile Information Device Profile

Mobile Information Device Profile Targets mobile two-way communication devices implementing J2ME CLDC Profile addresses Display toolkit, User input methods Persistent data storage using simple record-oriented database model HTTP-based networking using CLDC Generic Connection framework MIDP 1.0 spec and implementation available for download now

CLDC and MIDP Architecture MIDP Profile Applications OEM MID Profile CLDC (KVM) Operating System APIs

MIDP Application Lifecycle Pause Active Destroyed startApp destroyApp pauseApp MIDP applications are known as “MIDlets” MIDlets move from state to state in the lifecycle, as indicated. Start – acquire resources and start executing Pause – release resources and become quiescent (wait) Destroy – release all resources, destroy threads, and end all activity

Typical J2ME Technology Stack Mobile Information Device Profile KVM CLDC = KVM + J2ME Core APIs in this example DSP chip (e.g., ARM) J2ME core APIs Your MIDlet Yellow Pages, train schedules and ticketing, games… UI, HTTP networking... Threads, no Floats… 32-bit RISC, 256K ROM, 256K Flash, 64K RAM

MIDlet Suite MIDlets are package as a JAR MIDlets that are in the same suite can access each others database A descriptor file contains information pertaining to the suite Vendor name, version, size Name of each MIDlet Icons

Application Loading Process Web Page JAM Downloads App User Selects Advertise App on Network Transfer Java Application Manager (Name, Version, Size, …) Jar File Descriptor File

J2ME Application Screenshots

Agenda Overview of J2ME Developing J2ME Application

J2EE Architecture Client Tier Web Tier EIS Tier Integration Tier Business Tier

Key J2EE Components Enterprise Java Bean Servlet Java Server Pages Business logic packaging, distribution and access Servlet Java classes that extends the function of a web server Java Server Pages Templates used to generate content dynamically J2EE Connectors Generic access to back end EIS

Example of A J2EE Application EJB is used to encapsulate business logic and apply them to EIS back office systems Servlets are used to co-ordinate the interactions between users and EJBs JSPs are used to present forms, information and results back to the user

J2ME To J2EE Communication HTTP HTML Servlet J2ME Servlet EJB Container Web J2EE Application Server forward lookup Book

Handling J2ME Client A request is made to the servlet Process the request Servlet determines if the type of client Redirect to J2ME servlet for all J2ME client communications

Design Issues Networking Application messages Working offline Security

Networking J2ME side J2EE side Use HTTP 1.1 – requirement for all MIDP devices Use GET and POST communicating with web tier Client is responsible for HTTP headers and data J2EE side Use servlet to handle client request

MIDP Networking – Request 01 String url = “http://www.books.com/web/list?isdn=12345”; 02 03 HttpConnection con = (HttpConnection)Connection.open(url); 04 con.setRequestMethod(HttpConnection.POST); 05 06 con.setRequestProperty(“user-agent”, “CLDC-MIDP”); 07 con.setRequestProperty(“content-language”, “en”); 08 con.setRequestProperty(“content-type” 09 , “application/x-www-form-encoded”); 10 11 switch (con.getResponseCode( )) { 12 …

MIDP Networking – Response 01 InputStream is = con.openInputStream(); 02 03 if (is.getType( ) != “application/mybook-encoding”) 04 // Reject data stream 05 06 byte buffer = new byte[256]; 07 int size; 08 while ((size = is.read(buffer)) != -1) { 09 // Do something with data 10 11 is.close( ); 12 // Display the data

Servlet – Existing 01 public void doPost(HttpServletRequest req, 02 HttpServletResponse res) … { 03 04 // Looks up book 05 String isdn = req.getParameter(“isdn”); 06 07 if (req.getHeader(“user-agent”).equals(“CLDC-MIDP”) { 08 RequestDispatcher rd = req.getRequestDispatcher( 09 “MIDPcommunications”); 10 rd.forward(req, res); 11 return; 12 } 13 14 // Normal processing

Servlet – MIDP Servlet 01 public void doPost(HttpServletRequest req, 02 HttpServletResponse res) … { 03 04 res.setContentType(“application/mybook-encoding”); 05 06 ServletOutputStream os = res.getOutputStream( ); 07 // Write data out 08 09 os.flush( );

Application Messages Since 3G is NOT with us yet… Conserve bandwidth Send only the necessary data Accommodate high latency Send all required data in a single message Use Gauge to provide progress indication Message encodings Use binary messages Don’t use XML!!!

Working Offline MIDP supports record oriented database Data can be stored locally on the CLDC device Information stored in local databases can be manipulated Need to implement data synchronization

Security – Authentication Build HTTP basic authentication into MIDP application Servlet Container WWW-Authenticate: Basic realm=“fred” Authorization: Basic QWxhZGpbjpvcG… GET /get_list.html HTTP/1.1 01 if (con.getHeaderField(“www-authenticate”) != null) { 02 String authString = Base64.encode(login + “:” + password); 03 con.setRequestProperty(“authorization”, “basic “ + authString); 04 if (con.getResponseCode() != HttpConnection.HTTP_OK) { 05 // Do something … 06 else

Security – Authentication Use JSP/Servlet form login Use j_security_check method for authentication Required parameters are j_username and j_password 01 String url = “http://www.books.com/web/j_security_check”; 02 url += “?j_username=“ + username; 03 url += “&j_password=“ + password; 04 HttpConnection con = (HttpConnection)Connection.open(url); 05 06 con.setRequestMethod(HttpConnection.POST);

Security – Secure Transport HTTPS is not a requirement for MIDP 1.0 However… Vendors are implementing them J2ME for Palm supports HTTPS HTTPS support targeted for MIDP-NG

Summary Designed for small handheld devices Easy to program Works with J2EE It’s real and its available now!!!!

Getting Started on J2ME Java2 Standard Edition http://java.sun.com/j2se Java2 Micro Edition Wireless Toolkit http://java.sun.com/products/j2mewtoolki t/

Thank You