J2ME in a Nutshell

Book description

To the experienced Java developer, J2ME (the Java 2 Micro Edition) looks just familiar enough to be tempting, but just different enough to warrant caution. J2ME in a Nutshellprovides the extra security you need when venturing into programming for cell phones, PDAs and other consumer electronic devices. It gives you the reference material you need for J2ME, together with a tutorial that leverages your existing knowledge and teaches you what is different about J2ME without boring you to tears with details you already know. J2ME in a Nutshell provides a solid, no-nonsense reference to the "alphabet soup" of micro edition programming, covering the CLDC, CDC, KVM and MIDP APIs. The book also includes tutorials for the CLDC, KVM, MIDP and MIDlets, MIDlet user interfaces, networking and storage, and advice on programming small handhelds. Combined with O'Reilly's classic quick reference to all the core micro-edition APIs, this is the one book that will take you from curiosity to code with no frustrating frills in between

Table of contents

  1. J2ME in a Nutshell
    1. Preface
      1. Contents of This Book
      2. Related Books
      3. J2ME Programming Resources Online
      4. Examples Online
      5. Conventions Used in This Book
      6. Request for Comments
      7. Acknowledgments
    2. I. Introduction to the Java 2 Micro Edition Platform API
      1. 1. Introduction
        1. What Is the J2ME Platform?
          1. Configurations
          2. Profiles
        2. J2ME Specifications
        3. J2ME and Other Java Platforms
          1. JavaCard
          2. EmbeddedJava
          3. PersonalJava
      2. 2. The Connected Limited Device Configuration
        1. The CLDC Java Virtual Machine
          1. Virtual Machine and Language Features
            1. Floating point support
            2. Language omissions
            3. Class loading
          2. Security Features
            1. Class loading controls
            2. Access to native code
            3. Class verification
          3. Compiling and Running Code with the KVM
        2. The CLDC Class Libraries
          1. The java.lang Package
            1. The Object class
            2. Number-related classes
            3. Reflective features
            4. System properties
            5. The System and Runtime classes
            6. Threads
            7. Exceptions and errors
          2. The java.util Package
            1. Collection classes
            2. The Date class
            3. The TimeZone class
            4. The Calendar class
          3. The java.io Package
          4. The javax.microedition.io Package
        3. KVM Debugging
          1. The JPDA
          2. The KVM Implementation of the JPDA
          3. Debugging a KVM Application
        4. Advanced KVM Topics
          1. Preloading Java Classes
          2. Interfacing with Native Code
            1. Writing the Java code
            2. Determining the name of the native function
            3. Writing the native code
            4. Arranging for the native code to be compiled and included in the KVM
            5. Connecting the Java code to the native code
      3. 3. The Mobile Information Device Profile and MIDlets
        1. MIDP Overview
          1. MIDP Hardware Requirements
            1. Memory
            2. Display
            3. Input device
            4. Connectivity
          2. MIDP Software Requirements
        2. The MIDP Java Platform
        3. MIDlets and MIDlet Suites
          1. MIDlet Security
          2. MIDlet Packaging
        4. MIDlet Execution Environment and Lifecycle
        5. Developing MIDlets
          1. Building a MIDlet with the Wireless Toolkit
          2. Running a MIDlet
          3. A Simple MIDlet
          4. Timers and TimerTasks
        6. Delivery and Installation of MIDlets
          1. Over-the-Air Provisioning
          2. The Wireless Toolkit Application Management Software
      4. 4. MIDlet User Interfaces
        1. User Interface Overview
          1. The Display and Displayable Classes
          2. The High- and Low-Level User Interface APIs
        2. The High-Level User Interface API
          1. A TextBox Example
          2. Displaying the TextBox
          3. Accessing Resources in the MIDlet JAR File
          4. Commands
            1. Creating Commands
            2. Adding Commands to the user interface
            3. Responding to user activation of Commands
            4. A Command example
            5. Command placement
            6. Command placement on a PalmOS device
          5. Forms and Items
          6. Item State Changes
          7. High-Level API User Interface Components
          8. StringItems
          9. TextFields and TextBoxes
            1. Construction
            2. Field content changes and listener notification
            3. Constraints
          10. DateFields
            1. DateField in DATE_TIME mode
            2. DateField in DATE mode
            3. DateField in TIME mode
            4. Changing the DateField mode
          11. ImageItems
          12. Gauges
          13. ChoiceGroups and Lists
            1. Creating a ChoiceGroup
            2. Handling selection
            3. Setting and changing the selection
            4. Changing the content of a ChoiceGroup
            5. The List component
          14. Alerts
          15. Playing Sounds
      5. 5. The Low-Level MIDlet User Interface API
        1. The Canvas Class
          1. Screen Attributes
            1. Display methods
            2. Canvas methods
        2. Painting and the Graphics Class
        3. Graphics Attributes
          1. The Coordinate System
          2. Colors and Grayscale
        4. Drawing Lines and Arcs
          1. Lines and Rectangles
          2. Arcs
        5. Translating the Graphics Origin
        6. A Simple Animation MIDlet
          1. The Canvas showNotify( ) and hideNotify( ) Methods
        7. The Graphics Clip
        8. Rendering Text
          1. Fonts
          2. Text Positioning
        9. Images
          1. Creating Images
          2. Drawing Images
          3. Creating an Image Programmatically
        10. Event Handling
          1. Key Handling
          2. Using the Pointer
        11. Multithreading and the User Interface
          1. Serialization of User Interface Events
          2. Running Code in the Event Thread
      6. 6. Wireless Java: Networking and Persistent Storage
        1. A Networking Architecture for Small Devices
          1. Connection and Connector
          2. Types of Connection
        2. Sockets
          1. Client Sockets
          2. Server Sockets
        3. Datagrams
          1. Sending a Datagram
          2. Receiving Datagrams
          3. Replying to the Sender
        4. HTTP Connections
          1. Using HTTP
          2. Basic Use of HttpConnection
          3. HTTP Requests
          4. HTTP Responses
          5. An HTTP Example
            1. Fetching the HTML page
            2. Analyzing the HTML
        5. Persistent Storage
          1. Record Stores
          2. Records
          3. Record Enumerations
          4. Record Filters and Comparators
          5. Multithreading and Concurrent Access
          6. A RecordStore Example
      7. 7. The Connected Device Configuration and Its Profiles
        1. The CDC
          1. The CDC Virtual Machine
          2. Running Java Code with the CVM
          3. Debugging Java Code in the CVM
          4. CDC Class Libraries
          5. CDC Profiles
          6. The Foundation Profile
          7. The RMI Profile
          8. Other CDC Profiles
      8. 8. J2ME Command-Line Tools
        1. cvm: The Connected Device Configuration Virtual Machine
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Properties
          6. Debugging
          7. Examples
          8. See Also
        2. kdp: The KVM Debug Proxy
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Examples
          6. See Also
        3. kvm: The Kilobyte Virtual Machine
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Examples
          6. See Also
        4. midp: The MID Profile Execution Environment
          1. Availability
          2. Synopsis
          3. Description
          4. MIDlet Management and Storage
            1. Execution without permanent installation
            2. MIDlet suite management
          5. Options
          6. See Also
        5. emulator: The J2ME Wireless Toolkit Emulator
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Application Management Commands
          6. Examples
          7. See Also
        6. preverify: The KVM Class Preverifier
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Examples
          6. See Also
        7. MakeMIDPApp: JAD to PRC Conversion Tool
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Examples
        8. chMEKeyTool: Public Key Certificate Management Tool
          1. Availability
          2. Synopsis
          3. Description
          4. Options
          5. Examples
          6. See Also
      9. 9. J2ME Programming Environments
        1. The J2ME Wireless Toolkit
          1. J2ME Wireless Toolkit Overview
          2. Developing MIDlet Suites with the Wireless Toolkit
          3. Debugging MIDlets with the Wireless Toolkit
          4. Wireless Toolkit Localization Features
            1. Changing fonts
            2. Changing the available character encodings
          5. Secure Networking
            1. SSL, HTTPS, and certificates
            2. Using HTTPS with the J2ME Wireless Toolkit
        2. MIDP for PalmOS
          1. The PalmOS Emulator (POSE)
          2. MIDP for PalmOS Installation and Configuration
          3. Using MIDlet Suites with MIDP for PalmOS
            1. MIDlet suite conversion
            2. Using the converter with the J2ME Wireless Toolkit
            3. Using the converter GUI
            4. Using the converter command-line interface
            5. Installing and running MIDlet suites on a PalmOS device
            6. Application menus and preferences
            7. Display and input devices
            8. Game controls
            9. Keypad
            10. Soft buttons
        3. J2ME and Forte For Java
          1. Creating a Project and Importing Source Code
          2. Compiling MIDlet Source Code
          3. Creating the MIDlet JAR and JAD Files
          4. Running MIDlets
          5. Debugging MIDlets
        4. Other Integrated Development Environments
    3. II. API Quick Reference
      1. 10. J2ME Packages and Classes
        1. J2ME Packages
        2. J2SE Packages Not Present in J2ME
        3. J2ME Package Contents
          1. The java.io Package
          2. The java.lang Package
          3. The java.lang.ref Package
          4. The java.lang.reflect Package
          5. The java.math Package
          6. The java.net Package
          7. The java.rmi Package
          8. The java.rmi.activation Package
          9. The java.rmi.dgc Package
          10. The java.rmi.registry Package
          11. The java.rmi.server Package
          12. The java.security Package
          13. The java.security.acl Package
          14. The java.security.cert Package
          15. The java.security.interfaces Package
          16. The java.security.spec Package
          17. The java.text Package
          18. The java.util Package
          19. The java.util.jar Package
          20. The java.util.zip Package
          21. The javax.microedition.io Package
          22. The javax.microedition.lcdui Package
          23. The javax.microedition.midlet Package
          24. The javax.microedition.rms Package
      2. 11. java.io
        1. Package java.io
        2. ByteArrayInputStream
        3. ByteArrayOutputStream
        4. DataInput
        5. DataInputStream
        6. DataOutput
        7. DataOutputStream
        8. EOFException
        9. InputStream
        10. InputStreamReader
        11. InterruptedIOException
        12. IOException
        13. OutputStream
        14. OutputStreamWriter
        15. PrintStream
        16. Reader
        17. UnsupportedEncodingException
        18. UTFDataFormatException
        19. Writer
      3. 12. java.lang
        1. Package java.lang
        2. ArithmeticException
        3. ArrayIndexOutOfBoundsException
        4. ArrayStoreException
        5. Boolean
        6. Byte
        7. Character
        8. Class
        9. ClassCastException
        10. ClassNotFoundException
        11. Error
        12. Exception
        13. IllegalAccessException
        14. IllegalArgumentException
        15. IllegalMonitorStateException
        16. IllegalStateException
        17. IllegalThreadStateException
        18. IndexOutOfBoundsException
        19. InstantiationException
        20. Integer
        21. InterruptedException
        22. Long
        23. Math
        24. NegativeArraySizeException
        25. NullPointerException
        26. NumberFormatException
        27. Object
        28. OutOfMemoryError
        29. Runnable
        30. Runtime
        31. RuntimeException
        32. SecurityException
        33. Short
        34. String
        35. StringBuffer
        36. StringIndexOutOfBoundsException
        37. System
        38. Thread
        39. Throwable
        40. VirtualMachineError
      4. 13. java.util
        1. Package java.util
        2. Calendar
        3. Date
        4. EmptyStackException
        5. Enumeration
        6. Hashtable
        7. NoSuchElementException
        8. Random
        9. Stack
        10. Timer
        11. TimerTask
        12. TimeZone
        13. Vector
      5. 14. javax.microedition.io
        1. Package javax.microedition.io
        2. Connection
        3. ConnectionNotFoundException
        4. Connector
        5. ContentConnection
        6. Datagram
        7. DatagramConnection
        8. HttpConnection
        9. InputConnection
        10. OutputConnection
        11. StreamConnection
        12. StreamConnectionNotifier
      6. 15. javax.microedition.lcdui
        1. Package javax.microedition.lcdui
        2. Alert
        3. AlertType
        4. Canvas
        5. Choice
        6. ChoiceGroup
        7. Command
        8. CommandListener
        9. DateField
        10. Display
        11. Displayable
        12. Font
        13. Form
        14. Gauge
        15. Graphics
        16. Image
        17. ImageItem
        18. Item
        19. ItemStateListener
        20. List
        21. Screen
        22. StringItem
        23. TextBox
        24. TextField
        25. Ticker
      7. 16. javax.microedition.midlet
        1. Package javax.microedition.midlet
        2. MIDlet
        3. MIDletStateChangeException
      8. 17. javax.microedition.rms
        1. Package javax.microedition.rms
        2. InvalidRecordIDException
        3. RecordComparator
        4. RecordEnumeration
        5. RecordFilter
        6. RecordListener
        7. RecordStore
        8. RecordStoreException
        9. RecordStoreFullException
        10. RecordStoreNotFoundException
        11. RecordStoreNotOpenException
      9. Class, Method, and Field Index
    4. Index
    5. Colophon

Product information

  • Title: J2ME in a Nutshell
  • Author(s):
  • Release date: March 2002
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596002534