Java Reference
In-Depth Information
Listing 12-2. Bluetooth Dating Service—BTMIDlet.java
import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
import javax.bluetooth.*;
import java.io.IOException;
public class BTMIDlet
extends MIDlet
implements CommandListener, Runnable {
private DateClient mClient = null;
private Thread mServer = null;
private Command mExitCommand = new Command("Exit", Command.EXIT, 2);
private Display mDisplay = null;
private StringItem mDateContact = null;
private Form mForm = null;
private boolean mEndNow = false;
private String mLastContact = "";
private LocalDevice mLocalBT;
private StreamConnectionNotifier mServerNotifier;
private static final UUID DATING_SERVICE_ID =
new UUID("BAE0D0C0B0A000955570605040302010", false);
private String myPref = null;
private String myHeight = null;
private String myContact = null;
private String seekPref = null;
private String seekHeight = null;
private String seekContact = null;
public BTMIDlet() {
mClient = DateClient.getInstance();
myPref = getAppProperty("BTMIDlet-mypref");
myHeight = getAppProperty("BTMIDlet-myheight");
myContact = getAppProperty("BTMIDlet-mycontact");
seekPref = getAppProperty("BTMIDlet-seekpref");
seekHeight = getAppProperty("BTMIDlet-seekheight");
}
Search WWH ::




Custom Search