×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    94

    Problem in midlet

    Hi to all,

    I my midlet application, there are two files one is main midlet & other is canvas class. when I move from midlet to canvas and back from canvas to midlet & when I again move from midlet to canvas my application will exit.
    This issue occurs only in nokia touch screen phones. In rest one application will work fine.

    Any advice.
    Regards,
    Juned Ahmed

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Problem in midlet

    Cut Paste your code here or debuging....

    thanks,
    ~Amitabh

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    94

    Re: Problem in midlet

    yr code is too long I am sending you only main part.

    Here's my midlet code from where canvas is called...
    else if(cmd == cmdView && disp == activationForm)
    {
    try{
    screen = 5;
    //getMonths();
    canvasObj = new canvasUI(this);
    display.setCurrent(canvasObj);
    }
    catch(Exception e)
    {
    System.out.println("view report exception:="+e);
    showAlert(e.getMessage());
    }
    }

    here's my canvas class code which is called:

    public canvasUI(MainMIDlet obj) // canvas constructor
    {
    setFullScreenMode(true);
    width = getWidth();
    height = getHeight();
    System.out.println("height:"+height);
    records = null;
    reportdata = null;
    inputStr = new StringBuffer();
    halfWidth = width/2;
    halfHeight = height/2;
    loadImage();
    midletObj = obj;
    canvasRS = new Persist();
    initFont();
    }

    public void paint(Graphics g)
    {
    try{
    if(MainMIDlet.screen == 4) // this will run
    drawSubmitReport(g);
    else if(MainMIDlet.screen == 5)
    drawViewReport(g);
    }
    catch(Exception e)
    {
    System.out.println("exception in canvas paint:="+e);
    midletObj.showAlert(e.getMessage());
    }
    }

    private void drawSubmitReport(Graphics g)
    {
    String str = "Claims to be submitted";

    g.setColor(255,255,255);
    g.fillRect(0,0,width,height);
    wrapText(g,str,mediumFont,width/25,1);
    g.setColor(0,0,0);
    records = canvasRS.readServiceRec(midletObj.rsName2);
    wrapServiceRecord(g,records,mediumFont,width/25,height/10);
    drawSoftKeys(g,"Confirm","Back");
    }

    these are step by step methods which is called.
    Regards,
    Juned Ahmed

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Problem in midlet

    Quote Originally Posted by junedahmed View Post
    Hi to all,

    when I again move from midlet to canvas my application will exit.
    This issue occurs only in nokia touch screen phones. In rest one application will work fine.

    Any advice.
    What are you talking about?
    From the canvas to midlet,there is no sense of this, mildet is always there and is displaying your canvas.Why dont you call the method of the midlet class direct from the canvas.

    When you are making the object of the Canvas just pass this midlet reference in the constructor of the Canvas.
    And make an exitApp() method in midlet and call it from the canvas itself.Inside the exitApp() you just write the code to exit the app.

    How this sounds to you?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    94

    Re: Problem in midlet

    I have already done all the things that you have told, but my prob is still there
    Regards,
    Juned Ahmed

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Problem in midlet

    I my midlet application, there are two files one is main midlet & other is canvas class. when I move from midlet to canvas and back from canvas to midlet & when I again move from midlet to canvas my application will exit.
    What you are saying is that your midet is exiting.Just confuse about the bold lines,
    explain............
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  7. #7
    Registered User
    Join Date
    Jan 2010
    Posts
    94

    Re: Problem in midlet

    Hi,

    What I found the issue is, for first time when I goes from midlet to canvas class app. working fine. But in second attempt when I am trying to go from midlet to canvas then display will not set.
    How can we reset display?
    Please help.
    Regards,
    Juned Ahmed

  8. #8
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Problem in midlet

    Quote Originally Posted by junedahmed View Post
    Hi,
    for first time when I goes from midlet to canvas class app. working fine. But in second attempt when I am trying to go from midlet to canvas then display will not set.
    What do you mean by coming from Canvas to midlet?
    Suppose at the moment the current displayable you have set as the canvas hence you means you are going from midlet to canvas, and let suppose this is you first go..now what about when you say coming from the canvas to midelt..what are you doing/setting when you are coming back to the canvas.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. start midlet by bluetooth on S40
    By peba25 in forum Mobile Java Networking & Messaging & Security
    Replies: 15
    Last Post: 2009-11-05, 09:35
  2. MIDlet: Connection bluetooth problem
    By Wulfric in forum Bluetooth Technology
    Replies: 4
    Last Post: 2009-01-23, 14:30
  3. image full screen
    By Morbidick in forum Mobile Java General
    Replies: 8
    Last Post: 2008-12-04, 04:16
  4. Midlet Signing Problem
    By devdattac in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-10-07, 12:57
  5. Nokia 6610 MIDlet start problem
    By drkurt in forum Mobile Java General
    Replies: 1
    Last Post: 2004-01-27, 09:48

Posting Permissions

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