Class AccountViewer

java.lang.Object
  |
  +--javax.microedition.midlet.MIDlet
        |
        +--menu.QuitableMIDlet
              |
              +--AccountViewer

public class AccountViewer
extends QuitableMIDlet

This class implements a simple account manager. Information about each account is stored in an RMS data store.

The midlet first displays a single page root menu that contains one entry for each record in the store. The menu is created and updated by an AccountIndexPage object.

Each entry on the index page is an AccountPage object. Each AccountPage contains a reference to a StorableObject that describes the RMS record associated with this account. Each StorableObject has a reference to a UserAccount object that contains the same information as the record in the store.

When the user selects an account page, the information about that account is displayed and can be edited. When the editing is done, the data is written back out to the RMS store, the index list is rebuilt, and the user is returned to the root menu.


Constructor Summary
AccountViewer()
          Construct the screens needed to implement the account manager.
 
Method Summary
protected  void destroyApp(boolean u)
          Called by the application management software to signal the MIDlet to terminate and enter the Destroyed state.
protected  void pauseApp()
          Called by the application management software to signal the MIDlet to stop and enter the Paused state.
 void startApp()
          Initialize the various data objects and related screens.
 
Methods inherited from class menu.QuitableMIDlet
quitApp
 
Methods inherited from class javax.microedition.midlet.MIDlet
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountViewer

public AccountViewer()
              throws javax.microedition.rms.RecordStoreException,
                     java.io.IOException
Construct the screens needed to implement the account manager.

Method Detail

startApp

public void startApp()
Initialize the various data objects and related screens. Called by the application management software to signal the MIDlet that it has entered the Active state. In the Active state the MIDlet may hold resources. The method will only be called when the MIDlet is in the Paused state. If any exceptions occur, we immediately transition to the destroyed state.

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

protected void pauseApp()
Called by the application management software to signal the MIDlet to stop and enter the Paused state. In the Paused state the MIDlet must release shared resources and become quiescent. This method will only be called when the MIDlet is in the Active state.

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

protected void destroyApp(boolean u)
Called by the application management software to signal the MIDlet to terminate and enter the Destroyed state. In the destroyed state the MIDlet must release all resources and save any persistent state. This method may be called from the Paused or Active states.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
u - If true, the MIDlet must cleanup and release all resources. If false the MIDlet may throw MIDletStateChangeException to indicate it does not want to be destroyed at this time.