
Developing Wireless Applications using Java™ Technology Bill Day [email protected] www.billday.com Technology Evangelist Sun Microsystems Computing Is Ubiquitous l Mainframe era: one computer, many people l PC era: one person, one computer l As computing becomes ubiquitous: one person uses many computers, and these computers are networked 1 Agenda l Java™ 2 Platform and J2ME™ Platform l J2ME Platform and Mobile Service Technologies l CLDC Internals and Details l MIDP Details l Availability and Resources Java™ 2 Platform and J2ME™ Platform 2 Java™ 2 Platform Java™ 2 Platform, Micro Optional Edition (J2ME™) encompasses Packages VMs and core APIs specified via Optional Configurations as well as vertical— Packages or market-specific—APIs specified in Profiles Java 2 Enterprise Other Java 2 Personal RMI CDC Edition Profile Profile Profiles Standard ... (J2EE) Edition Core APIs (J2SE) Foundation Mobile Information Profile Device Profile Core APIs Java Java 2 Micro Edition Core APIs Card APIs Java Programming Language Java HotSpot ™ Java Virtual Machine (JVM) KVM 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 l A J2ME platform configuration defines a minimum Java platform for a family of devices u Broad range of devices in different areas u Similar requirements of memory size and processing capabilities 3 Configurations l May not contain any optional features l Defined through the Java Community ProcessSM initiative (JCP) l Subject to compatibility tests What Is a Profile? l A collection of Java™ technology-based APIs that supplement a Configuration to provide capabilities for a specific vertical market or device type l Defined through Java Community Process initiative l Subject to compatibility tests 4 The J2ME™ Platform and Mobile Service Technologies J2ME Platform Connected, Limited Device Configuration (CLDC) l Targeted at devices with u 160KB 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 CLDC 1.0 specification available for free download now l Sun provides CLDC reference implementation built using the KVM 5 Mobile Information Device Profile (MIDP) l Targets mobile two-way communication devices implementing J2ME CLDC l Profile addresses u Display toolkit, User input methods u Persistent data storage using simple record-oriented database model u HTTP-based networking using CLDC Generic Connection framework l MIDP 1.0 spec and implementation available for download now Example J2ME™ Technology Wireless Device Stack Your Yellow Pages, train MIDlet schedules and ticketing, games… Mobile Information UI, HTTP Device networking... Profile J2ME core APIs CLDC = Threads, no Floats… KVM + KVM J2ME Core 32-bit RISC, 256K ROM, APIs 256K Flash, 64K RAM in this DSP chip example (e.g., ARM) 6 What About Web Content for Mobile Devices? l Markup languages in use today to deliver Web content to device browsers: u Compact HTML (C-HTML) is an HTML-based markup deployed to millions of users in NTT DoCoMo’s i-mode network u The WAP Forum’s Wireless Markup Language (WML) is an emerging standard for content (data) delivered to mobile devices u HTML dominates Web content worldwide l WAP specifies its own protocols (Wireless Session Protocol, Wireless Transaction Protocol, etc.) Wireless Web Content Distribution Carriers Client Content or Wireless Devices Producers Portals Static Web Server Web or WML Content or WAP Browser Gateway Java Apps Dynamic Content Content Transcoding Java Application Manager Applicati MID Profile Java Applicationon Applications DistributDistribution J2ME CLDC ion 7 Example Java™ Technology Application Loading Process Advertise User JAM App on Selects Downloads Web Page App App Web Page (Name, Descriptor Network Transfer Java Application Version, File Manager Size, …) Jar File The Future: Transcoding and XHTML l Transcoders are becoming more capable and widely used l WML, C-HTML, and HTML are converging towards XHTML u XHTML is the re-writing of HTML as an XML- based markup language u XHTML Basic will be renderable everywhere u WAP Forum and W3C collaborating on XHTML WML The not too distant XHTML CHTML future... HTML 8 CLDC Internals and Details Scope of the CLDC Specification l Specifies VM features required of CLDC implementation in terms of additions to and deviations from “The Java™ Virtual Machine Specification” by Lindholm and Yellin l Specifies requirements for interfaces and APIs for the following: u Input/output, Networking u Security model u Internationalization features 9 Beyond the CLDC Scope l Specified in Profiles to be implemented on top of the CLDC: u User interface support u Event handling u High-level application model u Persistence support l One example specification of these remaining APIs: Mobile Information Device Profile (MIDP) CLDC Language and VM Compatibility l General goal: u Full Java programming language and Virtual Machine Specification compatibility l Only language-level exception: u Floating point not in CLDC 1.0 n 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 10 CLDC Language and VM Compatibility l 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 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.* l New classes introduced by CLDC are in package: u javax.microedition.* 11 CLDC Libraries: java.lang.* l java.lang.Object java.lang.Class l java.lang.Runtime java.lang.System l java.lang.Thread java.lang.Runnable l java.lang.String java.lang.StringBuffer l java.lang.Math java.lang.Throwable l java.lang.Byte java.lang. Long l java.lang.Integer java.lang.Boolean l java.lang.Character java.lang.Short CLDC Libraries: java.util.* l java.util.Vector java.util.Stack l java.util.Hashtable java.util.Enumeration l java.util.Random java.util.Calendar 12 CLDC Libraries: java.io.* l java.io.InputStream java.io.OutputStream l java.io.Reader java.io.Writer l java.io.DataInput java.io.DataOutput l java.io.InputStreamReader l java.io.OutputStreamReader l java.io.ByteArrayInputStream l java.io.ByteArrayOutputStream l java.io.PrintStream Comments on CLDC Libraries l Internationalization u 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 l Property support u No java.util.Properties class u Properties read using System.getProperty(String key) u Limited set of CLDC-specific properties supported 13 Networking, I/O and Storage Libraries l Standard Java technology networking, I/O and storage libraries are too large for CLDC devices u More than 100 classes u Total static size of classfiles more than 200 KB u Original classes were never designed for small devices Networking, I/O and Storage Libraries l CLDC specifies an alternative Generic Connection framework u More coherence in supporting different types of I/O u Consistent way of supporting different protocols u Improved portability of applications u Smaller footprint 14 Generic Connection Possibilities General form: Connector.open("<protocol>://<address>:<parameters>"); 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"); MIDP Details 15 Scope of the MIDP Specification l Primary goals: u Size: MIDP implementation must fit in small footprint (128KB ROM) u Efficiency: n must run on low-end microprocessors n must run in with limited heap size (32–200KB RAM) n minimal creation of garbage u Time to market is critical for manufacturers of Mobile Information Devices Beyond the MIDP Scope l To be implemented by device manufacturers, operators, or third party developers: u How an application actually gets on the device u The end-to-end security model u System- or OEM-specific technologies 16 MIDP Application Lifecycle l MIDP applications are known as “MIDlets” l MIDlets move from state to state in the lifecycle, as indicated. u 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 MIDlet Packaging l MIDlets are packaged in a JAR file including u Class files of the MIDlet(s) u Resource files u Manifest with application properties l Application Descriptors accompany MIDlet JARs and provide information including u Configuration properties u Pre-download properties n Size, version, storage requirements 17 MIDP Libraries l The MIDP specifies APIs for: u Persistent Storage u Networking u Timers u User Interface MIDP Persistent Storage l Lightweight record oriented database u Device independent API u Unique record ID for each record within a store u Records are arrays of bytes u Shared within MIDlet suite u Atomic update for single records u Support for enumeration, sorting and filtering
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages31 Page
-
File Size-