Documente Academic
Documente Profesional
Documente Cultură
Computing Is Ubiquitous
l
Mainframe era: one computer, many people PC era: one person, one computer As computing becomes ubiquitous: one person uses many computers, and these computers are networked
Java + XML + IP
Java + XML + IP
What the J2ME Platform is, including the architectural basics as well as some internal details (APIs, VM features, etc.). How the J2ME Platform complements WAP, imode, and other markup based wireless technologies, and how you can use them together in your applications. How to get started building and deploying J2ME-based wireless applications today.
Understand what the J2ME Platform is, and describe it in detail to others. Integrate J2ME components into preexisting wireless applications and services. Build entirely new kinds of graphics rich, secure, network-centric wireless applications for millions of Java powered mobile phones and PDAs the world over.
Agenda
l l l l l
Java 2 Platform and J2ME Platform J2ME Platform and Mobile Service Technologies CLDC Internals and Details MIDP Details Availability and Resources
Java 2 Platform
Optional Packages Optional Packages
Java 2 Platform, Micro Edition (J2ME) encompasses VMs and core APIs specified via Configurations as well as vertical or market-specificAPIs specified in Profiles
Personal Profile RMI Profile Other CDC Profiles ...
Foundation Profile
Card VM
What Is a Configuration?
l
A configuration defines the minimum Java technology libraries and virtual machine capabilities that an application developer/content provider can expect to be available on implementing devices A J2ME platform configuration defines a minimum Java platform for a family of devices
Broad range of devices in different areas u Similar requirements of memory size and processing capabilities
u
Configurations
l l l
May not contain any optional features Defined through the Java Community ProcessSM initiative (JCP) Subject to compatibility tests
What Is a Profile?
l
l l
A collection of Java technology-based APIs that supplement a Configuration to provide capabilities for a specific vertical market or device type Defined through Java Community Process initiative Subject to compatibility tests
to 512KB total memory available for Java technology u Limited power (often battery) u Limited, perhaps intermittent connectivity to a network (often wireless) u Extremely constrained UIs, small screens
l l
CLDC 1.0 specification available for free download now Sun provides CLDC reference implementation built using the KVM
toolkit, User input methods u Persistent data storage using simple record-oriented database model u HTTP-based networking using CLDC Generic Connection framework
l l
MIDP 1.0 spec and implementation available for download now MIDP Next Generation via JCP
Yellow Pages, train schedules and ticketing, games UI, HTTP networking...
KVM
DSP chip (e.g., ARM)
Threads, no Floats 32-bit RISC, 256K ROM, 256K Flash, 64K RAM
Compact HTML (C-HTML) is an HTML-based markup deployed to millions of users in NTT DoCoMos i-mode network u The WAP Forums Wireless Markup Language (WML) is an emerging standard for content (data) delivered to mobile devices u HTML dominates Web content worldwide
WAP specifies its own protocols (Wireless Session Protocol, Wireless Transaction Protocol, etc.)
Static Content
Java Applications
Web Page
Descriptor File
Network Transfer
Jar File
Transcoders are becoming more capable and widely used WML, C-HTML, and HTML are converging towards XHTML
XHTML is the re-writing of HTML as an XMLbased markup language u XHTML Basic will be renderable everywhere u WAP Forum and W3C collaborating on XHTML
u
10
Specifies VM features required of CLDC implementation in terms of additions to and deviations from The Java Virtual Machine Specification by Lindholm and Yellin Specifies requirements for interfaces and APIs for the following:
Input/output, Networking u Security model u Internationalization features
u
One example specification of these remaining APIs: Mobile Information Device Profile (MIDP)
11
General goal:
u Full
Java programming language and Virtual Machine Specification compatibility point not in CLDC 1.0
No hardware floating point support on most devices due to space limitations n Manufacturers and/or developers may choose to include their own floating point, however
VM Implementation differences:
u No
Java Native Interface (JNI) u No reflection u No thread groups u No weak references u No finalization u New implementation of bytecode verification using preverifier and bytecode annotations
12
CLDC Libraries
l
Classes inherited from Java 2 Platform, Standard Edition (J2SE version 1.3) are in packages:
u java.lang.* u java.util.* u java.io.*
13
java.io.InputStream java.io.OutputStream java.io.Reader java.io.Writer java.io.DataInput java.io.DataOutput java.io.InputStreamReader java.io.OutputStreamReader java.io.ByteArrayInputStream java.io.ByteArrayOutputStream java.io.PrintStream
14
Internationalization
Limited support for the translation of Unicode characters to and from a sequence of bytes u Implemented using Readers and Writers u By default, the only character encoding for which a converter is provided in ISO-LATIN1 u Localization implemented by manufacturer
u
Property support
No java.util.Properties class u Properties read using System.getProperty(String key) u Limited set of CLDC-specific properties supported
u
Standard Java technology networking, I/O and storage libraries are too large for CLDC devices
than 100 classes u Total static size of classfiles more than 200 KB u Original classes were never designed for small devices
u More
15
coherence in supporting different types of I/O u Consistent way of supporting different protocols u Improved portability of applications u Smaller footprint
Files:
Connector.open("file://billday.txt");
HTTP:
Connector.open("http://www.billday.com");
Sockets:
Connector.open("socket://129.144.111.222:9000");
Communication ports:
Connector.open("comm://9600:18N");
16
MIDP Details
Primary goals:
u Size:
u Time
17
an application actually gets on the device u The end-to-end security model u System- or OEM-specific technologies
MIDP applications are known as MIDlets MIDlets move from state to state in the lifecycle, as indicated.
Start acquire resources and start executing u Pause release resources and become quiescent (wait) u Destroy release all resources, destroy threads, and end all activity
u
18
MIDlet Packaging
l
MIDP Libraries
l
19
Device independent API Unique record ID for each record within a store Records are arrays of bytes Shared within MIDlet suite Atomic update for single records Support for enumeration, sorting and filtering
Integrity of data across reboots, battery changes Storage in flash or other device memory
Record Store
u openRecordStore,
closeRecordStore, listRecordStore, deleteRecordStore, getRecordSize, getNumRecords deleteRecord, getRecord, setRecord, getRecordSize RecordFilter,
Record Data
u addRecord,
Record Selection
u RecordEnumeration,
RecordCompare
20
MIDP Networking
l
MIDP devices must implement HTTP protocol, though this may or may not use IP-based transport underneath
MIDP networking extends from CLDC Generic Connection Framework HttpConnection includes methods:
u get/setRequestProperty u get/setRequestMethod u getResponseCode, u getHeaderField u getURL,
getResponseMessage
21
Mobile Information Devices are consumer products, not desktop computers u Unified user interface between MIDP applications and native apps on the device
n
22
MIDP UIs may be created using one of two layers of APIs Use the high-level APIs for portability
u
Applications using these APIs should be runnable and usable in all MIDP devices u No direct access to native device features Provide access to native drawing primitives, device key events, native input devices, etc. u Allow developers to choose to compromise portability for user experience, if needed
u
Low-level APIs
MIDlet UIs are built using simple screens Screens should contain minimum amount of information required
u Usually
23
High-level API input is handled using abstract commands instead of direct access to soft buttons
u Each
MIDP implementation maps these commands to appropriate soft buttons or menu items for the particular device u MIDlets can provide semantic hints (like back)
l
24
Buy Info
Back
MIDP NG Java Specification Request (JSR) states that MIDP NG spec will:
u Maintain
backward compatibility (MIDP 1.0). u Continue focus on high-volume wireless phones. u Maintain small footprint, limit API growth. u Fine tune MIDP 1.0 APIs. u Focus on core functions needed by all compliant devices and applications. u Focus on enabling mobile commerce, service-based applications
25
and secure networking (SSL/TLS). u Formal inclusion of Over The Air (OTA) Provisioning (Recommended Practice 1 for MIDP 1.0) as part of MIDP NG spec. u Network connectivity via sockets and datagrams. u Domain security model, including signing of applications and verification of certificates.
architecture (external events and messages routed to MIDlets). u Extensions to low level (game) LCDUI model to allow greater game functionality and layout control for larger screens. u Possible inclusion of a small XML parser to enabled platform-independent data exchange. u Basic sound API.
26
l l
J2ME CLDC and MIDP reference implementations freely available from Sun. KVM ports in various imode handsets, Motorola devices, RIM handhelds, and more. Symbian continues support for Java technology in the EPOC operating system, used in devices such as Nokias 9210 communicator. LG deployed J2ME in Korea beginning summer 2000, NTT DoCoMo deployed in Japan in its imode service in January 2001. Nextel is deploying in the US, Spring 2001. Agreements and projects with Vodaphone AirTouch, Sprint PCS, Telefonica, and others.
27
3GPP has announced adoption of J2ME CLDC and MIDP technologies for worldwide third generation (3G) mobile standards
Not yet
Not yet
28
l l
Sun J2ME Wireless Toolkit (optionally plugs into free Forte for Java IDE) MIDP reference, CLDC/KVM SDK (support for Win32, Solaris platform, Linux, and PalmOS) Metrowerks/Motorola J2ME tools, RIM BlackBerry IDE, Zucotto WHITEboard SDK, and more Any IDE or standard Java tool, including J2SE SDK (aka JDK 1.2.2 or 1.3) Tools from the J2ME Archive (Spotter utility, WBXML package, etc.)
29
30
They are available NOW. They are FREE. They are all you need to start writing great Java applications for mobile devices TODAY.
The kvm-interest mailing list is a free J2ME development list hosted by Sun
u u u
To subscribe, send email to: listserv@java.sun.com In the body of the message, type: subscribe kvm-interest For digest mode, include the following line: set kvm-interest digest
31
l l
J2ME: java.sun.com/j2me Connected, Limited Device Configuration specification and SDK: java.sun.com/products/cldc Mobile Information Device Profile specification and reference implementation: java.sun.com/products/midp Download the Sun J2ME Wireless Toolkit: java.sun.com/products/j2mewtoolkit J2ME Webcast: java.sun.com/jdc/onlineTraining/webcasts
Additional Resources
l l l l
l l
J2ME Archive: www.billday.com/j2me jGuru J2ME FAQ: www.jguru.com/faq/J2ME J2ME tutorial articles: java.sun.com/jdc/technicalArticles/wireless J2ME tools CD, available now as part of Java Jumpstart from Sun Developer Connection (SDC) Got questions? Email Suns Technology Evangelists: evangcentral@sun.com Or visit our homepage: www.sun.com/developers/evangcentral
32
Speaker Bio
Bill Day is a Technology Evangelist at Sun Microsystems. Bill created the J2ME Archive to help developers build applications and services using Java technology. He manages jGurus J2ME FAQ. Bill also writes about software development for numerous publications and teaches Java and Wireless development as an extension instructor for the University of California Berkeley. More information is available from Bills web site: www.billday.com
33
34