MIDlets

Am I correct in thinking that official OTA spec a .jad file should contain a valid URL to the location of the .jar file. If so why do over 50% of the .jad files I have looked at on the internet (including ones on sun's own web-site, simply have the name of the .jar file?
Surely this is not a valid URL, you have to assume that the .jar file is in the same location as the .jad file. Fine, only what happens if you only get access to the .jad file once it is on local sotorage?
I am developing a MIDlet downloder and manager for a prototype mobile phone who's web browser will download the .jad file and pass it to my application for me to download the .jar, there is no way of finding out where exactly the .jad file came from, therefore with the incorrect/incomplete .jar URLs I can have no idea of where to get the .jar file from.
What I would really like to know is has the OTA spec for MIDlet's really overlooked something as fundemental as this or is it a case of a large number of MIDlet creators (including Sun!) not following the spec correctly?
Paul.

I would tend to argue for the latter. Not all developers have access to persistent, Internet-accessible storage, and many of those that do must go through extra steps to upload to it, a real pain during the development process.
Jouster

Similar Messages

  • (Self-)signing a MIDlet for use on ~10 phones without spending money

    Hello everyone,
    I just spend like 4 hours researching how to sign MIDlet and I am totally confused.
    Instead of asking for general instructions I am going to explain what I want to do. Hopefully that will enable people to tell me whether or not this is possible and what steps I should take.
    What I want to do:
    * I have a MIDlet (JAR+JAD pair), written for J2ME CLDC 1.1/MIDP 2.0
    * This program needs to read and write files, as well as access GPS (using the Location API). I have specified the needed permissions in the JAD file (MIDlet-Permissions and MIDlet-Permissions-Opt)
    * The end goal is to be able to run this program on a limited number (<=10) of phones. All phones are Nokia handsets running S60 3rd Ed. FP1/2. They are owned by my organisation so the IMEI numbers are known
    * And now for the important thing: the program should not throw runtime warnings when files are accessed or the location API is used
    * Because this is an entirely non-commercial thing the whole process should not cost me any money
    So far I've been testing this application on a single Nokia N95-2 (8GB). Because the MIDlet is unsigned (or at least I believe that is why) it throws lots of runtime warnings (concerning file access and location access, eg: "Allow application X to read user data?" YES/NO). So this is exactly what I need to avoid when deploying this program on the ~10 other phones.
    I understand that it is most likely impossible to achieve this with a single "signed" file that can be deployed on all 10 phones. However, supposing there is some free(!) "(self-)signing" procedure that produces a MIDlet that will work without the runtime warnings on a specific phone (identified by IMEI#), I am perfectly willing to go through this procedure for every phone/IMEI involved.
    So is this possible? And if so, what are the steps I should take. Please give me as much info as possible. I've been googling for hours and I ave yet to find a decent explanation for a scenario like this.
    Thanks in advance!

    It is my understanding (from posts on other forums) that the procedure explained on that webpage ( [http://browndrf.blogspot.com|http://browndrf.blogspot.com] ) only works/worked on Nokia S60 2nd edition devices, due to a bug (or feature?) in Nokia's MIDP implementation. In the 3rd edition of the S60 platform this bug was fixed so the procedure no longer works.
    As for my own project, we bit the bullet and got ourselves a Verisign certificate after all (for a whooping $500). So the problem is solved, although it wasn't exactly cheap.
    Thanks for your helpful comments.
    Regards,
    M.S.

  • Midlet gets null values from servlet

    hey,
    based on one of the source code examples on the java.sun.com website i made a midlet/servlet application. the midlet is sending a product id to the servlet, the servlet queries the database and shows the productinformation, the midlet reads the servlet output and displays it on his midlet form
    when i invoke the servlet in my browser: http://localhost:8080/Magazijn/query?product=1 then everything works fine (i see: Product Name : Deur). when the midlet is invoking the servlet i see Product Name : null
    after hours of searching the only thing i could come up with is that the servlet isn't passing the string retrieved from the resultset to the midlet
    the strange thing is that when i papss a normal string, for instance:
    String test = "test";
    out.println(test);
    that he shows this correct both in my browser and midlet
    when i do this:
    prodName = resutl.getString("name");
    out.println(prodName);
    i see "Deur" in my browser, but i see "null" in my midlet
    anyone can help me?
    here's the servlet source:
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.Date;
    public class Magazijn extends HttpServlet {
    public void doGet(HttpServletRequest request,
              HttpServletResponse response)
                        throws IOException, ServletException {
              doPost(request,response);
    public void doPost(HttpServletRequest request,
              HttpServletResponse response)
                        throws IOException, ServletException {
         String url="jdbc:mysql://localhost/test?user=root&password=root";
         Connection con = null;
         Statement stmt;
         ResultSet rs;
         String query;
         int prodId;
         String prodNaam;
         String prodPlaats;
         String prodAantal;
         response.setContentType("text/plain");
         PrintWriter out = response.getWriter();
         BufferedReader br = request.getReader();
         String buf = br.readLine();
         try {
                   //laden van de mysql driver
                   Class.forName("com.mysql.jdbc.Driver");
                   //maken van connectie met database
                   con = DriverManager.getConnection (url, "root", "root");     
                   //aanmaken van statement object
                   stmt = con.createStatement();
                   //nakijken welke naam we zoeken van product
                   String prod = request.getParameter("product");
                   //uitvoeren van query en die opvangen in een resultset
                   query = "SELECT * from onderdelen where id="+prod;
                   ResultSet result = stmt.executeQuery(query);
                   result.next();
                   prodId = result.getInt("id");
                   prodNaam = result.getString("naam");
                   prodPlaats = result.getString("plaats");
                   prodAantal = result.getString("aantal");
              out.println(new Date());
              out.println("");
                   out.println("Product ID: "+prodId);
                   out.println("Productnaam: "+prodNaam);
                   out.println("Plaats: "+prodPlaats);
                   out.println("Aantal: "+prodAantal);
              catch(ClassNotFoundException e) {
                   out.println("Could not load database driver: " + e.getMessage());
              catch(SQLException e) {
                   out.println("SQLException caught: " + e.getMessage());
              finally {
                   //sluiten database connectie
                   try {
                        if (con != null) con.close();
                   catch (SQLException e) {}
    here's the midlet source:
    import javax.microedition.rms.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.Vector;
    public class MagazijnMidlet extends MIDlet implements CommandListener {
    Display display = null;
    List menu = null;
    TextBox input = null;
    String prodid = null;
    String url = "http://localhost:8080/Magazijn/query";
    static final Command backCommand = new Command("Terug", Command.BACK, 0);
    static final Command submitCommand = new Command("Verstuur", Command.OK, 2);
    static final Command exitCommand = new Command("Afsluiten", Command.STOP, 3);
    String currentMenu = null;
    public MagazijnMidlet() { }
    public void startApp() throws MIDletStateChangeException {
    display = Display.getDisplay(this);
    menu = new List("Maak uw keuze", Choice.IMPLICIT);
    menu.append("Opvragen product gegevens", null);
    menu.addCommand(exitCommand);
    menu.setCommandListener(this);
    mainMenu();
    public void pauseApp() { }
    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    void mainMenu() {
    display.setCurrent(menu);
    //Vraag om productnummer op te geven
    public void askProdid() {
    input = new TextBox("Geef Productnummer:","", 5, TextField.ANY);
    input.addCommand(submitCommand);
    input.addCommand(backCommand);
    input.setCommandListener(this);
    input.setString("");
    display.setCurrent(input);
    //Maken connectie midlet + verwerking
    void invokeServlet(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    StringBuffer b = new StringBuffer();
    TextBox t = null;
    try {
    c = (HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("IF-Modified-Since",
         "20 Jan 2001 16:19:14 GMT");
    c.setRequestProperty("User-Agent",
         "Profile/MIDP-1.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    // send request to the servlet.
    os = c.openOutputStream();
    String str = "product="+prodid;
    byte postmsg[] = str.getBytes();
    System.out.println("Length: "+str.getBytes());
    for(int i=0;i<postmsg.length;i++) {
    os.write(postmsg);
    // or you can easily do:
    //os.write(("product="+prodid).getBytes());
    os.flush();
    // receive response and display it in a textbox.
    is = c.openInputStream();
    int ch;
    while((ch = is.read()) != -1) {
    b.append((char) ch);
    System.out.print((char)ch);
    Form formProdGeg = new Form ("Gegevens product");
    StringItem infoItem = new StringItem("",b.toString());
    formProdGeg.append (infoItem);
    formProdGeg.addCommand (backCommand);
    formProdGeg.setCommandListener (this);
    display.setCurrent (formProdGeg);
    } finally {
    if(is!= null) {
    is.close();
    if(os != null) {
    os.close();
    if(c != null) {
    c.close();
    display.setCurrent(t);
    // event handler
    public void commandAction(Command c, Displayable d) {
    String label = c.getLabel();
    if(label.equals("Afsluiten")) {
    destroyApp(true);
    } else if (label.equals("Terug")) {
    mainMenu();
    } else if (label.equals("Verstuur")) {
    prodid = input.getString();
    try {
    invokeServlet(url);
    }catch(IOException e) {}
    } else {
    askProdid();
    tia
    lee

    Hi,
    first for some efficeincy, in your place your connection to the database in the init() method so you can have on instance of the connection.
    in your midlet place the ui initialization in its constructor
    ok, Why dont you try the query in the url
    i.e http://localhost:8080/Magazijn/query=";
    then as you input the product id without setting requests
    c = (HttpConnection)Connector.open(url+productid);
    i think it will work properly
    tell me what happens with you

  • Parameters from midlet to servlet

    Hi all,
    i have been trying to pass values from MIDlet (setRequestProperty(); ) and to servlet (request.getParameter();).
    but when i tried to print out the value, it just contained NULL value.
    I had a look at the java forum website, there were plenty of same problems and no one got right.
    I'll really appreciate it if anyone fixes this for me.
    ---------------------MIDLET-----------------------------------------------------------------------------
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    import org.kxml.*;
    import org.kxml.parser.*;
    public class MbankMIDlet  extends MIDlet implements CommandListener {
      private Display display;
      private Form loginForm = new Form("Login");
      private Form mainForm = new Form("MobileBank");
      private String loguserID;
      private String logpass;
      private String mSession;
      private StringItem stringItem = new StringItem(null,"");
      private TextField userIDTextField = new TextField("User ID", "", 8, TextField.NUMERIC);
      private TextField passwordTextField = new TextField("Password", "", 12, TextField.PASSWORD);
      static final Command loginCommand = new Command("Login", Command.OK, 1);
      static final Command exitCommand = new Command("Exit", Command.STOP, 1);
      static final Command backCommand = new Command("Back",Command.BACK, 1);
      public MbankMIDlet() {
        mainForm.append(stringItem);
        mainForm.addCommand(exitCommand);
        mainForm.addCommand(backCommand);
        mainForm.setCommandListener(this);
      public void startApp() throws MIDletStateChangeException {
        display = Display.getDisplay(this);
        loginForm.append(userIDTextField);
        loginForm.append(passwordTextField);
        loginForm.addCommand(loginCommand);
        loginForm.addCommand(exitCommand);
        loginForm.addCommand(backCommand);
        loginForm.setCommandListener(this);
        display.setCurrent(loginForm);
      public void destroyApp(boolean unconditional) {
        notifyDestroyed();
      public void mainMenu() {
        display.setCurrent(loginForm);
      public void pauseApp() {
        display = null;
        loginForm = null;
        mainForm = null;
        stringItem = null;
        userIDTextField = null;
        passwordTextField = null;
      public void commandAction(Command c, Displayable d) {
        String label = c.getLabel();
        if (label.equals("Exit")) {
          destroyApp(true);
           mSession = null;
        } else if (label.equals("Login")) {
          login();
        } else if (label.equals("Back")){
          mainMenu();
      private void login() {
        loguserID = userIDTextField.getString();
        logpass = passwordTextField.getString();
        Form waitForm = new Form("Waiting...");
        display.setCurrent(waitForm);
        Thread t = new Thread() {
          public void run() {
            connect();
        t.start();
      private void connect() {
        HttpConnection hc = null;
        InputStream in = null;
        OutputStream os = null;
        String url = getAppProperty("MbankMIDlet.URL");
        try {
          hc = (HttpConnection)Connector.open(url);
          hc.setRequestMethod(HttpConnection.GET);
          hc.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0" );
          hc.setRequestProperty("Content-Language", "en-US" );
          hc.setRequestProperty("Accept", "text/plain");
          hc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded" );
          hc.setRequestProperty("Connection","close");
          hc.setRequestProperty("loguserID", loguserID);
          hc.setRequestProperty("logpass", logpass);
          os = hc.openOutputStream();
          os.close();
    //      os.flush();  //tried close() and flush() but none of them worked.
          if (mSession != null) {
              hc.setRequestProperty("Cookie", mSession);
          // Read the session ID from a cookie in the response headers.
          String cookie = hc.getHeaderField("Set-cookie");
          if (cookie != null) {
              int semicolon = cookie.indexOf(';');
              mSession = cookie.substring(0, semicolon);
          in = hc.openInputStream();
          int rc = hc.getResponseCode();
          if( rc == HttpConnection.HTTP_OK ) { //HTTP_OK equals 200
            System.out.println("HttpConnection OK");
            StringBuffer xmlBuffer = new StringBuffer();
            String xmlString = null;
            int ch;
            while ( ( ch = in.read() ) != -1 )
              xmlBuffer.append( ( char )ch );
            xmlString = xmlBuffer.toString();
            stringItem.setText(xmlString);
          else if (rc == HttpConnection.HTTP_UNAUTHORIZED){//HTTP_UNAUTHORIZED equals 401
            System.out.println("HttpConnection Unauthorized");
            int contentLength = (int)hc.getLength();
            byte[] raw = new byte[contentLength];
            int length = in.read(raw);
            String s = new String(raw,0,length);
            stringItem.setText(s);
          in.close();
          hc.close();
        catch (IOException ioe) {
          stringItem.setText(ioe.toString());
        finally {
          display.setCurrent(mainForm);
    }---------------SERVLET----------------------------------------------------------------------------
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              HttpSession session = request.getSession();
              response.setContentType("text/plain");
              PrintWriter out = response.getWriter();
              String userID, password, userRole = null;
              try {
                                  userID = (String)request.getParameter("loguserID");
                  password = (String)request.getParameter("logpass");
                  System.out.println(userID); // "Null printed"              System.out.println(password);  // "Null printed"
              catch (Exception e) {
                   //If anything goes wrong, print the Exception message
                  e.printStackTrace(out);
    }Thanks.

    getParameter() can't parse the input stream well if there is any issues in the sent content. this is true, with varying mobile phone http impl.
    You would find the content at servlet, by using request.getInputStream() and reading the entire content.
    Here is the sample code:
    public static String readMobileData(final HttpServletRequest aRequest) throws Exception
         String lData = null;
         Enumeration params = aRequest.getParameterNames();
         while (params.hasMoreElements())
         //from real Nokia 6600 Mobile the request is sent as param, though
         //it is post
         String lName = params.nextElement().toString();
         lData = aRequest.getParameter(lName);
         System.out.println("\nParameter:" + lName + "=" + lData);
         if (lData == null)
         //in emulator the data is coming as inputstream
         ServletInputStream in = aRequest.getInputStream();
         DataInputStream dIn = new DataInputStream(in);
         lData = dIn.readUTF();
         lData = lData.substring(lData.indexOf("=") + 1);
         System.out.println("Stream Request:\n" + lData);
         return lData;
    Regards,
    Raja Nagendra Kumar,
    C.T.O,
    When Teja is Tasked, the Job Gets Done
    www.tejasoft.com

  • Open file from directory in MIDlet

    Hi there!
    Ia m developing a simple MIDlet application for bluetooth image transfer.
    Generally i want to have a random number of files in a directory and store them into a Vector in my program.
    I ve been searching the internet for 2 days and havent found anything different from using the clas File with fileinputstream.
    I am using Netbeans IDE 6.1. I downloaded the version with essentials for mobility. As i see there is NO library containing the class File in this compiler. Class File is just unrecognisable.
    Ofcourse i try to
    import java.io.file;
    -Do i do something wrong?
    -In MIDlets there is no class file?
    -Is there any other way of opening a file in microedition?
    -Furthermore i have a byte array with data of a file and i wonna store it into a new file.But i imagine if i solve the former problem that would be easy
    PS:When i store default values into vector my program works because jar file is correctly created with correct files and i transfer through connection the file and i display it to screen. I just cant take the names of the files in a directory.
    Ty in advance for your help

    You can't use Java SE classes in Java ME. Search for documentation for JSR-75: the File Connection API. Or check the documentation that came with your NetBeans mobility kit, it should be somewhere in the mobilityXx/WTKxxx/docs folder.
    Note that many mobile devices do not support this API, and to use it on those that do, you will require a signed MIDlet. Obtaining a digital signature can cost upward of US$ 300.
    If you're still interested, search for related topics in the [CLDC and MIDP forum|http://forums.sun.com/forum.jspa?forumID=76], which is also where you should post any further questions related to Java ME.
    db

  • [Request For Help] How To Send Email Midlet Using Secure Socket ?

    Hello, this is the first time i ask for help to forum.sun.com.
    i try to make secure connection for send email from MIDlet. Maybe you can check to my code :
    EmailMidlet.java
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    import javax.microedition.lcdui.;
    public class EmailMidlet extends MIDlet implements CommandListener{
    Display display = null;
    // email form fields
    TextField toField = null;
    TextField subjectField = null;
    TextField msgField = null;
    Form form;
    static final Command sendCommand = new Command("send", Command.OK, 2);
    static final Command clearCommand = new Command("clear", Command.STOP, 3);
    String to;
    String subject;
    String msg;
    public EmailMidlet() {
    display = Display.getDisplay(this);
    form = new Form("Compose Message");
    toField = new TextField("To:", "", 50, TextField.EMAILADDR);
    subjectField = new TextField("Subject:", "", 15, TextField.ANY);
    msgField = new TextField("MsgBody:", "", 90, TextField.ANY);
    public void startApp() throws MIDletStateChangeException {
    form.append(toField);
    form.append(subjectField);
    form.append(msgField);
    form.addCommand(clearCommand);
    form.addCommand(sendCommand);
    form.setCommandListener(this);
    display.setCurrent(form);
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    public void commandAction(Command c, Displayable d) {
    String label = c.getLabel();
    if(label.equals("clear")) {
    destroyApp(true);
    } else if (label.equals("send")) {
    to = toField.getString();
    subject = subjectField.getString();
    msg = msgField.getString();
    EmailClient client = new EmailClient(this,"[email protected]", to, subject, msg);
    client.start();
    }and EmailClient.java
    import javax.microedition.io.;
    import javax.microedition.lcdui.;
    import java.io.;
    import java.util.Date;
    public class EmailClient implements Runnable {
    private EmailMidlet parent;
    private Display display;
    private Form f;
    private StringItem si;
    private SecureConnection sc; //SSL
    private InputStream is;
    private OutputStream os;
    private String smtpServerAddress = "smtp.gmail.com"; //SSL
    String from;
    String to;
    String subject;
    String msg;
    public EmailClient(EmailMidlet m, String from, String to, String subject, String msg) {
    parent = m;
    this.from = from;
    this.to = to;
    this.subject = subject;
    this.msg = msg;
    display = Display.getDisplay(parent);
    f = new Form("Email Client");
    si = new StringItem("Response:" , " ");
    f.append(si);
    display.setCurrent(f);
    public void start() {
    Thread t = new Thread(this);
    t.start();
    public void run() {
    try {
    //SSL
    sc = (SecureConnection)
    Connector.open("ssl://"smtpServerAddress":465"); //smtp with SSL port 465
    sc.setSocketOption(SocketConnection.LINGER, 5);
    is = sc.openInputStream();
    os = sc.openOutputStream();
    os.write(("HELO there" "\r\n").getBytes());
    os.write(("EHLO" "\r\n").getBytes());
    os.write(("auth login" "\r\n").getBytes());
    os.write(("dHVnYXNha2hpci50cmlhZGl0eWFAZ21haWwuY29t" "\r\n").getBytes());
    os.write(("dGEuZW1haWxjbGllbnQ=" "\r\n").getBytes());
    os.write(("MAIL FROM:<">\r\n").getBytes());
    os.write(("RCPT TO:<">\r\n").getBytes());
    os.write("DATA\r\n".getBytes());
    // stamp the msg with date
    os.write(("Date: " new Date() "\r\n").getBytes());
    os.write(("From: "+from"\r\n").getBytes());
    os.write(("To: "to"\r\n").getBytes());
    os.write(("Subject: "subject"\r\n").getBytes());
    os.write((msg+"\r\n").getBytes()); // message body
    os.write(".\r\n".getBytes());
    os.write("QUIT\r\n".getBytes());
    StringBuffer sb = new StringBuffer();
    int ch = 0;
    while((ch = is.read()) != -1) {
    sb.append((char) ch);
    si.setText("SMTP server response - " + sb.toString());
    } catch(IOException e) {
    e.printStackTrace();
    Alert a = new Alert
    ("TimeClient", "Cannot connect to SMTP server. Ping the server to make sure it is running...", null, AlertType.ERROR);
    a.setTimeout(Alert.FOREVER);
    display.setCurrent(a);
    } finally {
    try {
    if(is != null) {
    is.close();
    if(os != null) {
    os.close();
    if(sc != null) {
    sc.close();
    } catch(IOException e) {
    e.printStackTrace();
    public void commandAction(Command c, Displayable s) {
    if (c == Alert.DISMISS_COMMAND) {
    parent.notifyDestroyed();
    parent.destroyApp(true);
    } When I try to debug project from netbeans, i found this error :
    Starting emulator in debug server mode on port 2668
    Connecting to 127.0.0.1 on port 2800
    nbdebug:
    Waiting for debugger on port 2668
    Waiting for KVM...
    Running with storage root temp.SonyEricsson_JP8_128x160_Emu10
    KdpDebugTask connecting to debugger 1 ..
    Running with locale: Indonesian_Indonesia.1252
    Connected to KVM
    Connection received.
    Attached JPDA debugger to localhost:2668
    java.io.IOException: error 10054 during TCP read +
    at com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(Protocol.java:299)+
    at com.sun.midp.io.BufferedConnectionAdapter.readBytes(BufferedConnectionAdapter.java:99)+
    at com.sun.midp.io.BaseInputStream.read(ConnectionBaseAdapter.java:582)+
    at com.sun.midp.ssl.Record.rdRec(+41)+
    at com.sun.midp.ssl.Record.rdRec(+5)+
    at com.sun.midp.ssl.In.refill(+18)+
    at com.sun.midp.ssl.In.read(+29)+
    at EmailClient.run(EmailClient.java:74)+
    Execution completed.
    5145824 bytecodes executed
    9258 thread switches
    1762 classes in the system (including system classes)
    0 dynamic objects allocated (0 bytes)
    0 garbage collections (0 bytes collected)
    debug:
    BUILD SUCCESSFUL (total time: 4 minutes 34 seconds)
    Regard
    Littlebro

    Don't multipost and don't use the browser's back button to edit your posts as that creates multiple postings. I've removed the other thread you started with the same questio.
    Also, don't post to long dead threads. I've blocked your post and locked the thread you resurrected.
    db

  • Write Access to a file in Tomcat server via J2me Midlet

    How to make write access to a file using midlet and HTTP connection?
    I have text file in the Tomcat server and I am able to read it with HTTP connection using emulator, but don't have idea how to make write access to the file. I'd like to write some text to the file.

    Thanks, but could you be more accurate. What methods should I use in the servlet and what methods in the midlet?
    Some links which concern this subject, would be nice too. I have tried with google, no success.

  • Problem with InputStream in a MIDlet

    I am doing some client/server networking using a socket connection in a MIDlet.
    When I make the socket connection I get a 220 reply.
    i.e "220 smtp.comcast.net"
    I read the status code from that response and then send the server my next command. (HELO). so far so good.
    The server returns a status code of 250. I can see that in my packet sniffer. again, this is a good thing.
    The problem is with my input stream. When I last read the input stream ch = is.read();
    the input stream didn't empty itself.
    So every time I get a response from the server, it appends to the last input I had.
    in this case:
    "220 smtp.comcast.net 250 comcast.net".
    I only expect to see:
    "250 comcast.net"
    I've tried is.close() and then reopening it when I expect a response from the server. This does not flush it.
    What can I do to rectify this?
    Thanks in advance,
    Mike

    or better, use a buffer to write to and give the number of read bytes to it:
    InputStream is; // from somewhere else in the MIDlet
    String rec;
    StringBuffer sb = new StringBuffer();
    byte[] buf = new byte[1024];
                   while( (c=is.read(buf)) != -1 ){
                        rec=new String(buf,0,c);
                        sb.append(rec);
                   };c is the number of bytes which were read from the input stream.
    so i save the read bytes into a new string, but only bytes 0-c from the bytearray buf.
    then, i append the whole string to a stringbuffer for later use.

  • Midlet working in wireless tool kit but not in real mobile

    I have created a midlet having a login form which will ask for username and password. once enter the details and click on submit button it will invoke servlet in our server. servlet connects to ms-access database and checks for autthentication and send valid or invalid message to the midlet. if it is valid then menu will be displayed otherwise display message login incorrect. it is working properly in the j2me wireless toolkit(emulator). but when the application is deployed in the mobile it is always getting in valid message and displaying login incorrect form.
    i am using apache as a webserver and it is connected to the tomcat using mod_jk to run servlets/jsps.
    thanks and regards
    phani.

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=710465

  • How to make gif-animations from java-midlets?

    I have produced a collection of Java animations as midlets.
    I am planning to make gif-animations of some of them.
    I suppose I can make a gif-picture of every frame of the applet
    through coding that myself in the code. Then I could take
    those gif-pictures and make an animation of them
    with some animation software. Is this a good approach?
    If so, what is the best software for doing this?

    What I need to do is to make color wallpapers. Do you know any better approach for doing this?

  • Activate a Midlet from an Applet

    Hi,
    I am trying to activate a Midlet from an Applet? Is this possible in any of the latest J2ME releases?
    Using SATSA I am able to send APDU commands from the Midlet to the Applet and start a scenario where my Applet and Midlet exchange information.
    Is this available in the opposite direction. I want that my Applet, when triggered by an event, be able to Activate\Wake Up the Midlet.
    I am a newbie to J2ME and after researching the web, still couldn't find an answer. Thanks for your help.
    Bye.

    You can communicate with servlet from an applet, using URL connection, and then send POST/GET methods through HTTP protocol, here is a code snippet,
    // applet side, this method will send a POST method to the servlet and then get url openstream to read a
    // returned object from the servlet, params should be in the form param1=value&param2=value etc...
    public Object getObjectFromServlet(String servletName,String params) {
        Object object = null;
        try {
          URL url = new URL(codeBase,
                            contextRoot + servletName + params);
          URLConnection con = url.openConnection();
          con.setUseCaches(false);
          InputStream in = con.getInputStream();
          ObjectInputStream result = new ObjectInputStream(in);
          object = result.readObject();
          result.close();
          in.close();
        catch (ClassNotFoundException ex) {
          System.err.println("ClassNotFoundException caught:" + ex.getMessage());
        catch (MalformedURLException ex) {
          System.err.println("MalformedURLException caught:" + ex.getMessage());
        catch (IOException ex) {
          System.out.println("IOException caught:" + ex.getMessage());
        return object;
    //servlet side
    public void doPost(HttpServletRequest request, HttpServletResponse response){
          //Extract all the necessary supplied parameters from the request object and configurations.
           String param1 = request.getParameter("param1");
           String param2 = request.getParameter("param2");
      try {
            ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
            out.writeObject(object);
            out.close();
          catch (IOException ioe) {
            System.err.println("IOException caught:" + ioe.getMessage());
    }

  • JSAPI - other languages than English; MIDlet - settings loading; JSAPI - al

    Hello!
    I need to create application which uses speech recognition. At first I thought about using CMU Sphinx (PocketSphinx or, possibly, Sphinx4). Later I thought about JSAPI. (Sphinx somehow uses JSAPI but I don't know what is the difference between JSAPI and Sphinx).
    I have read almost all (up to 6.7.9) of the following tutorial: http://java.sun.com/products/java-media/speech/forDevelopers/jsapi-guide.pdf. Unfortunately I couldn't've found one important thing, i.e. how to create acoustic model for other language than English?
    Thanks in advance for your answers :-)!
    PS There are some other things which I'd like to know:
    1) How to load some settings from file (I guess nowadays configuration files are created with the use of XML but I dunno)?
    2) How to maintain algorithm which is used by MIDlet which involves JSAPI? I mean there are some different things which my MIDlet needs to do. I guess it is good habit to divide different goals into separate parts of code (due to object-oriented programming).
         In my case there are some different things:
         a) speech recognition of audio input, i.e. changing input audio stream into output text string
         b) analysis of that text string and according to this string choosing the proper transition in my algorithm
         In general I have written my algorithm on sheet of paper and it takes about ten A4 sheets of paper. Because of it I thought there should be some way to write this algoritm maybe outside the code, in some kind of file which would contain this algorithm. Maybe there is other good way to implement this algorithm, not necesarilly in the code.
         c) sending of results through httpconnection with the use of POST method
         d) receiving in on TomCat on server
    3) Which method should I use to receive the recognized speech? I found these:
         a) FinalRuleResult, b) Result -> getBestToken, c) getSpokenText, d) ResultToken of RuleGrammar
    4) Can you give me any full examples of JSAPI usage? (Not just short parts of code like in this JSAPI guide)?
    Greetins :-)!

    Praveen, Yes the infoobject is language dependent.  The problem did not happen in BWQ but came up in BWP.  so I am not sure at this time what is causing in production that didn't happen in BWQ.
    Thanks,
    Syed.

  • Need help with my HttpConnection From Midlet To Servlet...

    NEED HELP ASAP PLEASE....
    This class is supposed to download a file from the servlet...
    the filename is given by the midlet... and the servlet will return the file in bytes...
    everything is ok in emulator...
    but in nokia n70... error occurs...
    Http Version Mismatch shows up... when the pout.flush(); is called.. but when removed... java.io.IOException: -36 occurs...
    also i have posted the same problem in nokia forums..
    please check also...
    http://discussion.forum.nokia.com/forum/showthread.php?t=105567
    now here are my codes...
    midlet side... without pout.flush();
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
    //                pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }this is the midlet side with pout.flush();
    showing Http Version Mismatch
    public class DownloadFile {
        private GmailMidlet midlet;
        private HttpConnection hc;
        private byte[] fileData;
        private boolean downloaded;
        private int lineNumber;
    //    private String url = "http://121.97.220.162:8084/ProxyServer/DownloadFileServlet";
        private String url = "http://121.97.221.183:8084/ProxyServer/DownloadFileServlet";
    //    private String url = "http://121.97.221.183:8084/ProxyServer/Attachments/mark.ramos222/GmailId111d822a8bd6f6bb/01032007066.jpg";
        /** Creates a new instance of DownloadFile */
        public DownloadFile(GmailMidlet midlet, String fileName) throws OutOfMemoryError, IOException {
            System.gc();
            setHc(null);
            OutputStream out = null;
            DataInputStream is= null;
            try{
                setHc((HttpConnection)Connector.open(getUrl(), Connector.READ_WRITE));
            } catch(ConnectionNotFoundException ex){
                setHc(null);
            } catch(IOException ioex){
                ioex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C1", ioex.toString(),
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
            try {
                if(getHc() != null){
                    getHc().setRequestMethod(HttpConnection.POST);
                    getHc().setRequestProperty("Accept","*/*");
                    getHc().setRequestProperty("Http-version","HTTP/1.1");
                    lineNumber = 1;
                    getHc().setRequestProperty("CONTENT-TYPE",
                            "text/plain");
                    lineNumber = 2;
                    getHc().setRequestProperty("User-Agent",
                            "Profile/MIDP-2.0 Configuration/CLDC-1.1");
                    lineNumber =3;
                    out = getHc().openOutputStream();
                    lineNumber = 4;
                    PrintStream pout = new PrintStream(out);
                    lineNumber = 5;
                    pout.println(fileName);
                    lineNumber = 6;
                    pout.flush();
                    System.out.println("File Name: "+fileName);
                    lineNumber = 7;
                    is = getHc().openDataInputStream();
                    long len = getHc().getLength();
                    lineNumber = 8;
                    byte temp[] = new byte[(int)len];
                    lineNumber = 9;
                    System.out.println("len "+len);
                    is.readFully(temp,0,(int)len);
                    lineNumber = 10;
                    setFileData(temp);
                    lineNumber = 11;
                    is.close();
                    lineNumber = 12;
                    if(getFileData() != null)
                        setDownloaded(true);
                    else
                        setDownloaded(false);
                    System.out.println("Length : "+temp.length);
                    midlet.setAttachFile(getFileData());
                    lineNumber = 13;
                    pout.close();
                    lineNumber = 14;
                    out.close();
                    lineNumber = 15;
                    getHc().close();
            } catch(Exception ex){
                setDownloaded(false);
                ex.printStackTrace();
                midlet.alertScreen = new AlertScreen("Error C2+ line"+lineNumber,
                        ex.toString()+
                        " | ",
                        null, AlertType.ERROR);
                midlet.alertScreen.setTimeout(Alert.FOREVER);
                midlet.display.setCurrent(midlet.alertScreen);
        public HttpConnection getHc() {
            return hc;
        public void setHc(HttpConnection hc) {
            this.hc = hc;
        public String getUrl() {
            return url;
        public void setUrl(String url) {
            this.url = url;
        public byte[] getFileData() {
            return fileData;
        public void setFileData(byte[] fileData) {
            this.fileData = fileData;
        public boolean isDownloaded() {
            return downloaded;
        public void setDownloaded(boolean downloaded) {
            this.downloaded = downloaded;
    }here is the servlet side...
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            if(request.getMethod().equals("POST")){
                BufferedReader dataIN = request.getReader();
                String fileName = dataIN.readLine();
                File file = new File(fileName);
                String contentType = getServletContext().getMimeType(fileName);
                response.setContentType(contentType);
                System.out.println("Content Type: "+contentType);
                System.out.println("File Name: "+fileName);
                int size = (int)file.length()/1024;
                if(file.length() > Integer.MAX_VALUE){
                    System.out.println("Very Large File!!!");
                response.setContentLength(size*1024);
                FileInputStream fis = new FileInputStream(fileName);
                byte data[] = new byte[size*1024];
                fis.read(data);
                System.out.println("data lenght: "+data.length);
                ServletOutputStream sos = response.getOutputStream();
                sos.write(data);
    //            out.flush();
            }else{
                response.setContentType("text/plain");
                PrintWriter out = response.getWriter();
                BufferedReader dataIN = request.getReader();
                String msg_uid = dataIN.readLine();
                System.out.println("Msg_uid"+msg_uid);
                JDBConnection dbconn = new JDBConnection();
                String fileName = dbconn.getAttachment(msg_uid);
                String[] fileNames = fileName.split(";");
                int numFiles = fileNames.length;
                out.println(numFiles);
                for(int i = 0; i<numFiles; i++){
                    out.println(fileNames);
    out.flush();
    out.close();
    Message was edited by:
    Mark.Ramos222

    1) Have you looked up the symbian error -36 on new-lc?
    2) Have you tried the example in the response on forum nokia?
    3) Is the address "121.97.220.162:8084" accessible from the internet, on the device, on the specified port?

  • How can I pass arguments from one MIDlet to another MIDlet

    Hi everybody !
    Can anybody help me in knowing that how can I pass the parameters from one
    MIDlets to another one in same application.
    I am devloping a application in which I am using more than two MIDlet and I
    want to transfer Parameter from one MIDlet to another one.
    I just explain what I have done....
    I made a MIDlet "A" and "B" in the same project using NetBeans IDE.
    In MIDlet "A" I create the Object of MIDlet "B" so that the constructor of
    MIDlet "B" is called and parameter can be transferred.
    But when I run the program it shows me two MIDlet on the screen, that I
    doesn't need.
    Suggestion are most welcome....
    Thanks in advance
    Regards
    Bhagwat

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • How can I display a list of records from a JSP to my Midlet ??

    Hi there !
    I'm new in J2ME. I have been strugling with this problem for weeks now. All I find on the net is some theory and is not helping me much. Here the deal
    I have created a Midlet that shoud display a certain list which is from the remote database. The list comes from a JSP file in the server. When I use the browser I can see the list.
    The problem comes when I have to take the same list and output it in my midlet file. Then finding the selected index of the selecte item of the same list and using it somewhere else.
    I would appreciate it if somone could help me !!
    My head is speaning now !!! If you want me to post my code so one could identidy the proble, I don't mind !! Help please !!

    Here is my Code !!
                 String url = "http://10.2.25.3:8080/CreateAppointment/doctorsList.jsp";
        String dateUrl = "http://10.2.25.3:8080/CreateAppointment/date.jsp";
       String myUsername,myPassword;
       // Custom declaration code starts here
       public CreateAppointment_GUI()
                //Creating a login Form
                loginScreen = new Form("Login");
                //Login form Textfields
                username = new TextField("Username:", null, 200, TextField.ANY);
                password = new TextField("Password:", "Initial text", 200, TextField.ANY|     TextField.PASSWORD);
                loginScreen.append(username);
                loginScreen.append(password);
                //Adding the commands
                loginScreen.addCommand(loginCommand);
                loginScreen.addCommand(cancelCommand);
                loginScreen.setCommandListener(this);
                loginScreen.setItemStateListener(this);
                // Creating my selection list
                String[] selectionList = { "1.Appointments", "2.Add New Patient", "3.Patient Details" };
                listSelectAction = new List("Select Action", List.IMPLICIT, selectionList, images);
                listSelectAction.addCommand(backCommand);
                listSelectAction.addCommand(nextCommand);
                listSelectAction.setCommandListener(this);
             public void startApp() throws MIDletStateChangeException
               display = Display.getDisplay(this);
               display.setCurrent(loginScreen);
            public void pauseApp()
            public void destroyApp(boolean unconditional) throws MIDletStateChangeException
                 notifyDestroyed();
            public void itemStateChanged(Item item)
       void getDoctors(String url) throws IOException {
                    HttpConnection connection = null;
            InputStream is = null;
            OutputStream os = null;
            StringBuffer stringBuffer = new StringBuffer();
            TextBox textBox = null;
            String newStr =null;
            String newStr2=null;
            Vector v = new Vector();
           try {
              connection = (HttpConnection)Connector.open(url);
              connection.setRequestMethod(HttpConnection.POST);
              //connection.setRequestProperty(String key, String value)
              connection.setRequestProperty("IF-Modified-Since","20 Jan 2001 16:19:14 GMT");
              connection.setRequestProperty("User-Agent","Profile/MIDP-2.0 Confirguration/CLDC-1.0");
              connection.setRequestProperty("Content-Language", "en-CA");
              connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
              os = connection.openOutputStream();
              is = connection.openInputStream();
              int ch;
              while ((ch = is.read()) != -1) {
                stringBuffer.append((char) ch);
                System.out.print((char)ch);
                   }//while
              newStr = stringBuffer.toString();
                    newStr2=newStr.trim();
                    int start = 0;
                    position = newStr2.indexOf("%", 0);
                    while ((position = newStr2.indexOf("%",start)) > -1) {
                      String aName = newStr2.substring(start,position);
                      v.addElement(aName); // store the substring
                      start = position + 1; // so the next time we start checking following the space
              String[] theNames = new String[v.size()]; // create an array big enough to store the strings
              v.copyInto(theNames); // Now theNames is a String array with the list of names
               // now we can create a List using this array:
               listDoctors = new List("Select Doctor", List.IMPLICIT, theNames,null);
               listDoctors.addCommand(backCommand);
               listDoctors.addCommand(nextCommand);
               listDoctors.setCommandListener(this);
          } //try
           finally {
               if(is!= null) {
                  is.close();
               } //if
               if(os != null) {
                  os.close();
               }//if
               if(connection != null) {
                  connection.close();
               }//if
            }//final
         display.setCurrent(listDoctors);
        } //invoke
    public void commandAction(Command c, Displayable d)
                     if (c == loginCommand)
                      myUsername = username.getString();
                      myPassword = password.getString();
                         Thread thread = new Thread() {
                               public void run() {
                                   try {
                                      getDoctors(url);
                                      display.setCurrent(listSelectAction);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread.start();
                     else if (c == cancelCommand && d == listSelectAction)
                     else if (c == nextCommand && d == listSelectAction)
                        int selectedAction = listSelectAction.getSelectedIndex();
                            Alert displayNewText =
                            new Alert("Selected","Screens are still being developed", null, AlertType.INFO);
                                displayNewText.setTimeout(1000);
                         if (selectedAction == 0)
                             Thread thread = new Thread() {
                               public void run() {
                                   try {
                                      getDoctors(url);
                                      display.setCurrent(listSelectAction);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread.start();
                         if (selectedAction == 1)
                               display.setCurrent(displayNewText);
                         if (selectedAction == 2)
                               display.setCurrent(displayNewText);
                     }//Else
                     else if (c == backCommand && d == listDoctors)
                          display.setCurrent(listSelectAction);
                     else if (c == nextCommand && d == listDoctors)
                             Thread thread1 = new Thread() {
                               public void run() {
                                   try {
                                      getDate(dateUrl);
                                      display.setCurrent(listDate);
                                   }// Try
                                   catch (IOException ioe) {
                                      ioe.printStackTrace();
                                   }// catch
                               }// Public void
                         };//Thread
                          thread1.start();
                     else if (c == backCommand && d == listDate)
                          display.setCurrent(listDoctors);
    }That is my midlet !! Now here is the code for my JSP !!
                        <%@ page import="java.sql.*" %>
    <%@page import="java.util.*,java.text.*" %>
    <%
    String name="";
    String id = "";
    String connectionURL = "jdbc:microsoft:sqlserver://10.2.25.223;DatabaseName=NDOH_PAAB";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    %>
    <%
    try
                            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
                    catch (Exception ex)
                            out.println(ex.toString());
                            connection = DriverManager.getConnection(connectionURL,"remotepaab_user","mohwiti2004");
                            statement = connection.createStatement();
                            String mysql ="SELECT * from physicians";
                            //out.println(mysql);
                            rs = statement.executeQuery(mysql);
    %>
    <%
          while (rs.next()) {
                 name= rs.getString("name");
                 id = rs.getString("id");
                 out.print(name + "%");
                 out.print(id + "%");
    %>
    <%
    %>
    <% rs.close(); %>In the JSP the name variable is the one that has my List. The problem is how do I say in my Midlet = display the list contained in name. Or in id. I need to use both of them "name + id". the id I will use to find out which name a user ha selected !! Not sure how !!!
    Any help would be appreciated !! Thanks !!

  • Is there *any* way to ping MIDlet using default SMS/call (j2me)

    Hi,
    I'm writing a server style MIDlet which is polling a bluetooth device, the nature of the server is such that the phone running the MIDlet (in my case, a Motorola L6) is dedicated, it needs do nothing other than run the server, it is assumed it will not be used for anything else. Specifically the only phone calls or SMS messages it receives should be specific ping requests to server. The server will run 24/7, and should be resistant to being suspended by incoming calls (I've noted this could be a problem in itself).
    All I really want is for a 3rd party, without any special client software, to be able to ping the server (prompt it) to dispatch a set of text data to a pre-defined phone number via SMS (using WMA TextMessage).
    Basically someone should be able to set up the server, and then, with any phone (with no specific client MIDlet installed), be able to call or SMS the server and get a response posted back (to a fixed number, not necessarily to originating phone number).
    Does anyone know any way, no matter how hacky (needn't be pretty), to achieve this? You cannot receive SMS notifications on default port. An incoming call will call pauseApp which I could use - but not resume it, so server remains suspended. There are ways around having app suspended on receipt of call/SMS, but they involve never receiving the pauseApp notification, so I'm back to square one. I've wondered if I could check the free disk space on the MIDP profile (somehow) to 'detect' when it reduces in size, thus suggesting an SMS must have come in. Can a user send an SMS to a specific port with standard SMS-send interface (certainly can't see how myself, as no ':' character available). Can you hack the phone to re-route incoming SMS messages to something other than the default port?
    Is there a specific phone that might do this (I just need a phone supporting j2me bluetooth API, needn't be motorola L6)?.
    I think this can be done with Symbian (of which I know very little), and ultimately I might need to start programming with that, but I'd really prefer to continue using j2me..
    Any ideas would be greatly appreciated, I've spent a fair bit of time trolling for answers with only limited success.
    Cheers
    Edited by: bbloff on Oct 10, 2007 8:50 PM

    The tunnel default gateway is needed to let the internal firewall and router handle the routing for all decrypted IPsec packets. Today, after a Cisco IOS? EasyVPN Client connects to a Cisco IOS EasyVPN Server, there is no simple way for the client to send the tunnel traffic to the internal corporate network (other than to have the entire routing table on the IPsec gateway). In this type of implementation, the Cisco IOS routers use the default gateway to route all packets toward the Internet that do not have a more specific route. The tunnel default gateway gives customers the flexibility to control how they handle IPsec tunneled traffic

Maybe you are looking for

  • How to define a default size to JToolBar's Buttons?

    The size of the buttons of my JToolBar is relative to the text I write on them, I want all buttons to have the same default size.. I'm searching on google, on forums, on documentation.. but still don�t find nothing.. Any idea?

  • How can i download adobe photoshop cs5 version?

    i want to download it from internet ....but how can i get it?

  • How to add customized column in the time sheet CATS (transaction CAT2) ?

    Hello, I need to be able to add some columns in the time sheet CAT2 containing: - the name and first name of the person (in addition of the number), in display mode in the CATS time sheet. - a  text that I will found by reading some tables and values

  • Migo reversal - balance in transaction currency (program terminate)

    hello gurus i want to reverse the migo document with movt type 122 but it will get terminate the program with following error   A balance has occurred in transaction currency 'INR' with the   following details:   Exchange rate '00', amount '         

  • Problem with _mm_loadl_epi64

    Hi, I'm using the mmloadl_epi64 intrinsic to get a movq instruction however it gives different results when compiled Debug or Performance. I Performance mode it seems OK however Debug generates incorrect leaq instruction. Expected output is: loadl_ep