Java Reference
In-Depth Information
// Wait until acceptor thread is done
try {
mServer.join();
} catch (InterruptedException e) {} // Ignore
try {
mClient.stopClient();
} catch (Exception e) {} // Ignore
}
protected void pauseApp() {
}
protected void startApp() {
if (mForm == null) {
mForm = new Form("OBEXMIDlet");
mDateContact = new StringItem("Potential date found at:",null);
mForm.append(mDateContact);
mForm.addCommand(mExitCommand);
mForm.setCommandListener(this);
}
mDisplay = Display.getDisplay(this);
mDisplay.setCurrent(mForm);
mEndNow = false;
startServer();
mClient.setMyInfo(myPref, myHeight, myContact);
mClient.startClient();
mOpHandler = new OperationHandler(this);
}
private void startServer() {
if (mServer != null)
return;
// Start server thread
mServer = new Thread(this);
mServer.start();
}
public void run() {
try {
mServerNotifier = (SessionNotifier) Connector.open(url);
} catch (Exception e) {
System.err.println("Can't initialize OBEX server: " + e);
}
Search WWH ::




Custom Search