Java Reference
In-Depth Information
Listing 14-8. The MMSMidlet Class
package com.apress.rischpater.mmsmidlet;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.wireless.messaging.*;
import java.io.IOException;
public class MMSMIDlet
extends MIDlet
implements CommandListener, Runnable, MessageListener {
private MMSSender sender = null;
private Command exitCommand = new Command("Exit", Command.EXIT, 2);
private Command sendCommand = new Command("Send", Command.SCREEN, 1);
private TextField numberEntry = null;
private static final String FRACTAL_PATH = "/icons/fractal.png";
private ImageItem imageItem = null;
private Form form = null;
private boolean endNow = false;
private MessageConnection c = null;
private final String appId = "MMSMIDlet";
protected int msgAvail = 0;
private final Integer monitor = new Integer(0);
public MMSMIDlet() {
sender = MMSSender.getInstance();
}
public void commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d) {
if (c == exitCommand) {
if (!sender.isSending()) {
destroyApp(true);
notifyDestroyed();
}
 
Search WWH ::




Custom Search