Skip to content

Nokia 6230 developer analysis

April 10, 2004

Nokia 6230

Peter Rogers’ brain dump of J2ME and related developer issues for the Nokia 6230 (part of a 6230 thread on the kvm-interest list) is worth a read for anyone interested in J2ME MIDP 2.0 development on Developer Platform 2.0 for Series 40 devices (the 6230 is the reference device).

From → Uncategorized

2 Comments
  1. schien wang's avatar
    schien wang permalink

    Why this program make VM of Nokia 6230 broke reboot?

    package de.skkoeln.j2me;

    import java.io.*;
    import javax.microedition.lcdui.*;

    import javax.microedition.midlet.*;
    import javax.microedition.pki.CertificateException;

    public class HTTPMIDlet
    extends MIDlet
    implements CommandListener, Runnable {
    private static final int DEFAULT_COMMAND_PRIORITY = 1;
    private static final Command EXIT_COMMAND = new Command(“Exit”, Command.EXIT,
    DEFAULT_COMMAND_PRIORITY);

    javax.microedition.lcdui.Form form;
    javax.microedition.lcdui.Gauge gauge;
    public HTTPMIDlet() {
    form = new javax.microedition.lcdui.Form(“J2EESOFT”);
    }

    public void run() {

    String reason;
    try {
    javax.microedition.io.HttpsConnection con = (
    javax.microedition.io.HttpsConnection)
    javax.microedition.io.Connector.open(
    “https://nexus.passport.com/rdr/pprdr.asp”);
    /*in = con.openInputStream();
    StringBuffer responseBuf;
    long length = con.getLength();
    if (length > 0) {
    responseBuf = new StringBuffer( (int) length);
    }
    else {
    responseBuf = new StringBuffer();
    }
    int ch;
    while ( (ch = in.read()) != -1) {
    responseBuf.append( (char) ch);
    }
    String responseStr = responseBuf.toString();
    String rewrittenUrl = con.getHeaderField(“X-RewrittenURL”);
    String readServer = con.getHeaderField(“Server”);

    if (rewrittenUrl != null) {
    String url = rewrittenUrl;
    }*/
    //System.out.println(responseStr);
    /*
    int readResponseCode = con.getResponseCode();
    TextBox textBox = new TextBox(“ResponseCode”,
    Integer.toString(readResponseCode),
    1000, TextField.UNEDITABLE);
    textBox.addCommand(EXIT_COMMAND);
    textBox.setCommandListener(this);
    Display.getDisplay(this).setCurrent(textBox);
    for (int i = 0; i < 1000; i++) {
    System.out.println(i);
    }

    Form waitForm = new Form("HTTPS SK TEST…");
    Gauge gauge = new Gauge("Testing HTTPS…", false, Gauge.INDEFINITE,
    Gauge.CONTINUOUS_RUNNING);
    waitForm.append(gauge);
    Display.getDisplay(this).setCurrent(waitForm);
    for (int i = 0; i < 500; i++) {
    System.out.println(i);
    }*/
    String PassportURLs = con.getHeaderField("PassportURLs");
    TextBox textBox = new TextBox("PassportURLs Info", PassportURLs,
    PassportURLs.length(), TextField.UNEDITABLE);
    textBox.addCommand(EXIT_COMMAND);
    textBox.setCommandListener(this);
    Display.getDisplay(this).setCurrent(textBox);

    }
    catch (CertificateException certEx) {
    switch (certEx.getReason()) {
    case CertificateException.BAD_EXTENSIONS:
    reason = "Certificate contains unrecognized extensions";
    break;
    case CertificateException.BROKEN_CHAIN:
    reason =
    "Certificate was not issuied by next certificate in the chain";
    break;
    case CertificateException.CERTIFICATE_CHAIN_TOO_LONG:
    reason = "Too long certificate chain";
    break;
    case CertificateException.EXPIRED:
    reason = "Certificate has already expired";
    break;
    case CertificateException.INAPPROPRIATE_KEY_USAGE:
    reason = "Certificate usage not acceptable";
    break;
    case CertificateException.MISSING_SIGNATURE:
    reason = "Certificate does not contain a signature";
    break;
    case CertificateException.NOT_YET_VALID:
    reason = "Attempte to use a Certificate not valid yet";
    break;
    case CertificateException.ROOT_CA_EXPIRED:
    reason = "Certificate's root CA has expired";
    break;
    case CertificateException.SITENAME_MISMATCH:
    reason = "Certificate's referred sitename is incorrect";
    break;
    case CertificateException.UNAUTHORIZED_INTERMEDIATE_CA:
    reason = "One of the certificates in the chain is not authorized";
    break;
    case CertificateException.UNRECOGNIZED_ISSUER:
    reason = "Certificate's issuer is unrecognized";
    break;
    case CertificateException.UNSUPPORTED_PUBLIC_KEY_TYPE:
    reason = "The type of the public key is not supported";
    break;
    case CertificateException.UNSUPPORTED_SIGALG:
    reason = "Certificate's signature algorithm is not supported";
    break;
    case CertificateException.VERIFICATION_FAILED:
    reason = "Certificate could not be validated";
    break;
    default:
    reason = "Unknown reason";
    break;
    }
    TextBox bx = new TextBox("Fehler", reason, reason.toString().length(),
    TextField.UNEDITABLE);
    Display.getDisplay(this).setCurrent(bx);

    }
    catch (IOException ex) {
    reason = ex.getMessage();
    TextBox bx = new TextBox("Https Test Result", reason, reason.length(),
    TextField.UNEDITABLE);
    Display.getDisplay(this).setCurrent(bx);

    }
    }

    public void commandAction(Command cmd, Displayable source) {
    if (cmd == EXIT_COMMAND) {
    try {
    destroyApp(false);
    }
    catch (MIDletStateChangeException ex) {
    }
    notifyDestroyed();
    }
    }

    protected void destroyApp(boolean p1) throws MIDletStateChangeException {
    }

    protected void startApp() throws MIDletStateChangeException {
    Form waitForm = new Form("HTTPS SK TEST…");
    Gauge gauge = new Gauge("Testing HTTPS…", false, Gauge.INDEFINITE,
    Gauge.CONTINUOUS_RUNNING);
    waitForm.append(gauge);
    Display.getDisplay(this).setCurrent(waitForm);
    Thread t = new Thread(this);
    t.start();
    }

    protected void pauseApp() {
    }
    }

    Pls help me, thanks

    Schien Wang

  2. Yair Barzilai's avatar
    Yair Barzilai permalink

    Hello,
    My WML site sends a WML deck to 6230 browser.
    A do type="accept" ... paragraph with label =”send” … is NOT presented or effective in any way, while it IS on a lot of other phones’ browsers.

    Thanks for any advice !!
    YAir B.

Comments are closed.

Design a site like this with WordPress.com
Get started