Methods Summary |
---|
private void | cleanUp()Clean up
display = null;
mainMenu = null;
if (wmafw != null) {
wmafw.stopFramework();
wmafw = null;
}
|
public void | commandAction(Command c, Displayable d)Command/button listener
Thread th = new Thread(this);
thCmd = c;
th.start();
|
public void | destroyApp(boolean uc)Destroy state. Release resources (connection, threads, etc).
cleanUp();
|
public void | onBinaryMessage(java.lang.String from, byte[] message)New Binary Message Notification Callback.
if (from != null) mainMenu.setTicker(UIConstants.TXT_NEW_BIN_MSG + from);
|
public void | onTextMessage(java.lang.String from, java.lang.String message)/
/**
New Text Message Notification Callback.
if (from != null) mainMenu.setTicker(UIConstants.TXT_NEW_TEXT_MSG + from);
|
public void | pauseApp()Paused state. Release resources (connection, threads, etc).
|
public void | run()Runnable entry point, controls the application (WMAMIDlet) navigation.
try {
if (thCmd == MainMenuScreen.EXIT) {
cleanUp();
notifyDestroyed();
} else if (thCmd == MainMenuScreen.SELECT) {
int index = mainMenu.getMenuSelection();
if (index == SELECTION_EMAIL) {
if (wmafw != null) wmafw.showInbox(mainMenu.getScreen());
mainMenu.setTicker(""); // reset ticker
} else if (index == SELECTION_CALENDAR) {
Alert alert = new Alert(UIConstants.MSG_NI, UIConstants.MSG_CALENDAR_TBI, null, AlertType.INFO);
display.setCurrent(alert);
} else if (index == SELECTION_CONTACTS) {
Alert alert = new Alert(UIConstants.MSG_NI, UIConstants.MSG_CONTACTS_TBI, null, AlertType.INFO);
display.setCurrent(alert);
}
}
} catch (Exception e) {
e.printStackTrace();
System.out.println("WMAMIDlet.run Exception " + e);
}
|
public void | startApp()Initial state
try {
// Get the LCDI Display context
if (display == null) {
display = Display.getDisplay(this);
}
// Initialize the Application's Main Menu
if (mainMenu == null) {
mainMenu = new MainMenuScreen(display, this);
}
if (mainMenu != null) mainMenu.showMenu();
// Get the WMA Framework Singleton Instance
if (wmafw == null) {
wmafw = WMAFramework.getInstance(display);
if (wmafw != null) {
wmafw.setIncomingMessageListener(this);
wmafw.createServerConnection();
mainMenu.setTicker(UIConstants.TXT_ACTIVE_SMSC + wmafw.getSMSC());
}
}
} catch(Exception e) {
// If some kind of error ocurred, throw MIDlet exception.
throw new MIDletStateChangeException(UIConstants.TXT_ERROR_STARTING + e);
}
|