Java Reference
In-Depth Information
protected void startApp() {
if (mForm == null) {
mForm = new Form(mAppID);
mNumberEntry = new TextField("Connect to:",
null, 256, TextField.PHONENUMBER);
try {
mInitialImage = Image.createImage(DEFAULT_IMAGE);
} catch (Exception ex) {
System.out.println("starttApp caught: ");
ex.printStackTrace();
}
mColorSquare = new ImageItem(null, mInitialImage,ImageItem.
LAYOUT_DEFAULT, "waiting for image");
mForm.append(mNumberEntry);
mForm.append(mColorSquare);
mForm.addCommand(mExitCommand);
mForm.addCommand(mRedCommand);
mForm.addCommand(mBlueCommand);
mForm.setCommandListener(this);
}
Display.getDisplay(this).setCurrent(mForm);
try {
conn = (MessageConnection) Connector.open("mms://:" + mAppID);
conn.setMessageListener(this);
} catch (Exception e) {
System.out.println("startApp caught: ");
e.printStackTrace();
}
if (conn != null) {
startReceive();
}
}
private boolean mEndNow = false;
private void startReceive() {
mEndNow = false;
// Start receive thread
mReceiver = new Thread(this);
mReceiver.start();
}
protected MessageConnection conn = null;
Search WWH ::




Custom Search