×

Discussion Board

Results 1 to 9 of 9

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    8

    I can't run java application on emulator

    Hi,

    I compiled sources of helloworldplus demo application with javac 1.4.2_06. I can install it on Emulator but it is impossible to run it. No error is generated - after launch nothing happens.

    The original jar of hello application can be loaded and run successfully. The only difference is that in my jar are classes compiled by me, JAD and manifest are the same except jar size parameter in jad.

    Does anybody know how to fix it?
    Where can I find any log?

    I'm using Emulator from S60 3rd SDK for MIDP.

    Regards,
    kempston

  2. #2
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: I can't run java application on emulator

    well its very difficut to say wat might be cause, so u try to put some system.out in the code and try if the app is starting or not, and in catch block print the excepcetion and see if any comming.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    8

    Re: I can't run java application on emulator

    I put try-catch in startApp(), but nothing changed. Application is installable but I cannot run it. No error, no visible effects. In diagnostic tools I can't see HelloWorldPlus process. It seems that launching engine in emulator in some reason doesn't work with my application.

    To be completely sure I produced following code and experienced the same:

    package ex3;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    public class Class1 extends MIDlet {
    public void startApp() {
    try {
    System.out.println("It's OK!");
    } catch (Exception e) {
    e.printStackTrace(System.out);
    }
    }
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    }

    Is it possible to switch emulator to generate log with internal events?

  4. #4
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: I can't run java application on emulator

    well buddy i did minor changes in your code and it working fine on wtk tool kit...

    package ex3;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;

    public class Class1 extends MIDlet {
    public void startApp() {
    try {
    System.out.println("It's OK!");
    } catch (Exception e) {
    System.out.println(e);
    }
    }
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    }
    well wat emulator u using...depending on that u can generate internal logs.... wtk emulator u can enbale logs by setting preferences...

  5. #5
    Registered User
    Join Date
    Sep 2007
    Posts
    8

    Re: I can't run java application on emulator

    Yes, on WTK it can run.

    I installed this application in FP1 emulator and then I've got the same error which was described by mnoromaa in http://discussion.forum.nokia.com/fo...d.php?t=107166

  6. #6
    Super Contributor
    Join Date
    Jun 2007
    Location
    Mumbai
    Posts
    539

    Re: I can't run java application on emulator

    Well buddy i tried that code on series 60 3rd edition emulator and it is not working but just try this one if its wokring on ur emulator or not..

    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    import javax.microedition.*;

    public class MIDlet00 extends MIDlet {

    TestCanvas testCanvas;

    public MIDlet00(){
    super();
    }
    protected void startApp() throws MIDletStateChangeException {
    testCanvas = new TestCanvas(this);
    }
    protected void pauseApp() {
    // TODO Auto-generated method stub
    }
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    // TODO Auto-generated method stub
    }
    } // MIDlet

    class TestCanvas extends Canvas {
    private Display display;
    private static int keyCode=0;
    private MIDlet midlet;
    private final String exitCommandString = "Exit";
    public TestCanvas(MIDlet midlet){
    this.midlet = midlet;
    display = Display.getDisplay(this.midlet);
    display.setCurrent(this);
    }
    public void paint(Graphics g){
    g.setColor(0x000000);
    g.fillRect(0,0,getWidth(),getHeight());
    g.setColor(0xFFFFFF);
    g.drawString(exitCommandString,getWidth()/2,getHeight(),Graphics.HCENTER|Graphics.BOTTOM);
    g.drawString("KeyPressed Code: "+keyCode,5,10,Graphics.LEFT|Graphics.TOP);
    g.drawString("Screen Size: "+getWidth()+"x"+getHeight(),5,50,Graphics.LEFT|Graphics.TOP);
    }
    protected void keyPressed(int key){
    System.out.println("Key Pressed: "+key);
    if(getGameAction(key)==FIRE)
    midlet.notifyDestroyed();
    keyCode = key;
    repaint();
    }
    }

Similar Threads

  1. How do you run an application on the emulator on the PC so a phone can see it
    By johncogan in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2006-02-21, 14:39
  2. My application run perfectly on Emulator but can't run on mobile device (Socket)
    By x1054 in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2005-11-07, 21:12
  3. How to run my application in J-Sky emulator
    By bb_sathya in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-09-01, 08:12
  4. Unable to run application error inside the application
    By prakala in forum Mobile Java General
    Replies: 2
    Last Post: 2003-05-27, 22:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •