Appendix D. The iAppli API

Packages

The iAppli API contains five major packages:

  • com.nttdocomo.io—. Input/output over the network (using HTTP) and to/from the ScratchPad.

  • com.nttdocomo.lang—. The standard language constructs specific to iApplis.

  • com.nttdocomo.net—. Networking support classes.

  • com.nttdocomo.ui—. The user interface, image, sound, and canvas components.

  • com.nttdocomo.util—. Other supporting utility classes.

com.nttdocomo.io Interfaces

There is just one class for input and output:

java.lang.Object
 java.lang.Throwable
  java.lang.Exception
   java.io.IOException
    com.nttdocomo.io.ConnectionException

com.nttdocomo.io Interfaces

Define the communication with HTTP. Extend from both InputConnection and OutputConnection:

javax.microedition.io.Connection
 javax.microedition.io.InputConnection
  javax.microedition.io.StreamConnection
   javax.microedition.io.ContentConnection
    com.nttdocomo.io.HttpConnection
 javax.microedition.io.OutputConnection
  javax.microedition.io.StreamConnection
   javax.microedition.io.ContentConnection
    com.nttdocomo.io.HttpConnection

com.nttdocomo.lang

Called if an unsupported operation or method is called during runtime.

java.lang.Object
 java.lang.Throwable
  java.lang.Exception
   java.lang.RuntimeException
    com.nttdocomo.lang.UnsupportedOperationException

com.nttdocomo.net

Converts a character string into a valid URL format. This handles Chinese or Japanese characters.

java.lang.Object
 com.nttdocomo.net.URLDecoder
  com.nttdocomo.net.URLEncoder

com.nttdocomo.ui

java.lang.Object
  • com.nttdocomo.ui.AudioPresenter—. An audio control class that implements com.nttdocomo.ui.MediaPresenter.

  • com.nttdocomo.ui.Component—. All high-level API components derive from com.nttdocomo.ui.Component.

  • com.nttdocomo.ui.Button—. Defines a button, implements com.nttdocomo.ui.Interactable.

  • com.nttdocomo.ui.ImageLabel—. Defines a still image.

  • com.nttdocomo.ui.Label—. Defines a non-editable character string.

  • com.nttdocomo.ui.ListBox—. A list box component that implements com.nttdocomo.ui.Interactable.

  • com.nttdocomo.ui.TextBox—. A text input component that implements com.nttdocomo.ui.Interactable.

  • com.nttdocomo.ui.Ticker—. A ticker component that scrolls text to the left.

  • com.nttdocomo.ui.VisualPresenter—. A component that displays visual media, implements com.nttdocomo.ui.MediaPresenter.

  • com.nttdocomo.ui.Display—. Displays the current screen and processes keystrokes or other input.

  • com.nttdocomo.ui.Font—. Controls the calligraphic text style, size, and family.

  • com.nttdocomo.ui.Frame—. The actual visual frame itself. Superclass of com.nttdocomo.ui.Canvas.

  • com.nttdocomo.ui.Canvas—. An abstract low-level display class that draws pixels to the screen.

  • com.nttdocomo.ui.Dialog—. A dialog box.

  • com.nttdocomo.ui.Panel—. A high-level UI display class, capable of holding UI components.

  • com.nttdocomo.ui.Graphics—. Controls all drawing function in the Canvas class.

  • com.nttdocomo.ui.IApplication—. The main class that starts, stops, and manages the application.

  • com.nttdocomo.ui.Image—. Holds the actual image data.

  • com.nttdocomo.ui.MediaManager—. A media management processing class.

  • com.nttdocomo.ui.PhoneSystem—. Accesses and handles the settings of the mobile phone.

  • com.nttdocomo.ui.ShortTimer—. A basic interval timer function, implements com.nttdocomo.util.TimeKeeper.

    java.lang.Throwable
    java.lang.Exception
    java.lang.RuntimeException
    
  • com.nttdocomo.ui.UIException—. A common exceptional class for problems related to the user interface.

com.nttdocomo.ui Interfaces

There are several interfaces to support the UI classes:

com.nttdocomo.util.EventListener
  • com.nttdocomo.ui.ComponentListener—. Defines the listener, handling any events that occur to a component.

  • com.nttdocomo.ui.KeyListener—. Defines the listener that corresponds to key presses while the high-level UI is being displayed.

  • com.nttdocomo.ui.MediaListener—. Defines the listener that corresponds to media events, such as a sound starting or stopping.

  • com.nttdocomo.ui.SoftKeyListener—. Defines the event listener of the software key in the high-level UI.

  • com.nttdocomo.ui.FocusManager—. Manages which component in a Panel currently has focus.

  • com.nttdocomo.ui.Interactable—. Defines a component that can be interacted with on-the-fly.

  • com.nttdocomo.ui.LayoutManager—. Defines where components are placed in a Panel.

  • com.nttdocomo.ui.MediaPresenter—. Defines the media type.

  • com.nttdocomo.ui.MediaResource—. Resource management superclass of MediaData, MediaImage, and MediaSound.

  • com.nttdocomo.ui.MediaData—. Defines something that is media.

  • com.nttdocomo.ui.MediaImage—. A graphic image.

  • com.nttdocomo.ui.MediaSound—. An audio sound.

com.nttdocomo.util

The Timer class allows events to be triggered on a regular basis:

java.lang.Object
com.nttdocomo.util.Timer

com.nttdocomo.util Interfaces

Defines all listeners, for events or timers:

com.nttdocomo.util.EventListener
 com.nttdocomo.util.TimerListener
com.nttdocomo.util.TimeKeeper

IApplication

The IApplication class starts the program and manages everything. Your program should derive from this class. The actual classes in IApplication are as follows:

  • IApplication()—. Constructor.

  • java.lang.String[] GetArgs()—. Gets the starting parameters of the application.

  • static IApplication GetCurrentApp()—. Gets the current application instance.

  • java.lang.String GetSourcecUrl()—. The URL from which the application was originally downloaded.

  • void resume()—. Called after the application has been interrupted, due to a voice phone call or other pause event.

  • abstract void start()—. Called when the application first executes.

  • void terminate()—. Ends the application cleanly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.113.55