public void commandAction(Command c, Displayable s) { if (c.getCommandType() == Command.EXIT) notifyDestroyed(); else { Form waitForm = new Form("Connecting..."); mDisplay.setCurrent(waitForm); Thread t = new Thread(this); t.start(); } }
public void run() { String url = getAppProperty("HttpsMIDlet-URL");
try { // Query the server and retrieve the response. HttpsConnection hc = (HttpsConnection)Connector.open(url);
SecurityInfo si = hc.getSecurityInfo(); Certificate c = si.getServerCertificate(); String subject = c.getSubject();
String s = "Server certificate subject: /n" + subject; Alert a = new Alert("Result", s, null, null); a.setTimeout(Alert.FOREVER); mDisplay.setCurrent(a, mForm);