×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Jan 2006
    Location
    CPH, Denmark
    Posts
    64

    Question Close midlet when call arrives

    Hi everybody

    Does anybody know how to close a midlet when a call arrives? I've tried to make a simple program where I call destroyApp(bool) from pauseApp() but it does not work - does anybody have an idea why?

    I'm testing on a E60 (s60 3. edition)

    Regards Mads

  2. #2
    Regular Contributor
    Join Date
    May 2003
    Posts
    151

    Re: Close midlet when call arrives

    Quote Originally Posted by madsbjoern
    I call destroyApp(bool) from pauseApp() but it does not work - does anybody have an idea why?
    Because it's not meant to do anything until you implement it.

    protected abstract void destroyApp(boolean unconditional)
    throws MIDletStateChangeException
    To terminate your application you just need to terminate all running threads - and maybe set the current display to null if you feel like it.

    Btw calling the exiting routines directly from pauseApp may not be a good idea - pauseApp is one of those external event functions (like keypressed and commandActions) that really ought to be returned from quickly to avoid locking up the phone while it executes.

  3. #3
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: Close midlet when call arrives

    Hi,
    Is ur program entering pauseApp(hideNotify/showNotify) when an incoming call occurs.
    Thanks
    Soku

  4. #4
    Regular Contributor
    Join Date
    May 2003
    Posts
    151

    Re: Close midlet when call arrives

    Usually, though on some phone these functions don't get called...

  5. #5
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Close midlet when call arrives

    Hi Mads,

    "...where I call destroyApp(bool) from pauseApp() but it does not work - does anybody have an idea why?
    I'm testing on a E60 (s60 3. edition)"


    Danack is right. AFAIK on S60 devices pauseApp() will not get called. It can be different on other devices/platforms such as UIQ, etc.

    If you are using Canvas, then use the hideNotifiy() method that will be called when your MIDlet is backgrounded by a system screen and then call notifyDestroyed().

    If using Forms, you can use the method isShown() of Displayable class.

    Hope this helps!

    Juarez Jr
    Juarez Alvares Barbosa Junior - Brazil

  6. #6
    Regular Contributor
    Join Date
    Jan 2006
    Location
    CPH, Denmark
    Posts
    64

    Re: Close midlet when call arrives

    Thanks juarezjunior, I'll try the "isShown()"-method out - PauseApp() is unfortunately not called on the phone when the call arrives...

    Regards Mads

    Quote Originally Posted by juarezjunior
    Hi Mads,

    "...where I call destroyApp(bool) from pauseApp() but it does not work - does anybody have an idea why?
    I'm testing on a E60 (s60 3. edition)"


    Danack is right. AFAIK on S60 devices pauseApp() will not get called. It can be different on other devices/platforms such as UIQ, etc.

    If you are using Canvas, then use the hideNotifiy() method that will be called when your MIDlet is backgrounded by a system screen and then call notifyDestroyed().

    If using Forms, you can use the method isShown() of Displayable class.

    Hope this helps!

    Juarez Jr

  7. #7
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Close midlet when call arrives

    just to confirm, pauseApp() is never called on Nokia implementations.
    when working with Canvases, used hideNotify() to find out if the application is sent to background.
    for high-level UI apps use isShown(), like instructed above.

    Hartti

  8. #8
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: Close midlet when call arrives

    Hi Mads,

    Interesting to say is that the MIDP 3.0 Expert Group is considering the possibility of making the pauseApp() deprecated.

    You can get the directions to the whole discussion by reading this excellent post by Hartti - http://blogs.forum.nokia.com/view_entry.html?id=577

    Nice to know, thank you Hartti
    Juarez Alvares Barbosa Junior - Brazil

  9. #9
    Regular Contributor
    Join Date
    Jan 2006
    Location
    CPH, Denmark
    Posts
    64

    Thumbs up Re: Close midlet when call arrives

    All right, thanks a lot for the info, Juarez and Hartti!

    Quote Originally Posted by juarezjunior
    Hi Mads,

    Interesting to say is that the MIDP 3.0 Expert Group is considering the possibility of making the pauseApp() deprecated.

    You can get the directions to the whole discussion by reading this excellent post by Hartti - http://blogs.forum.nokia.com/view_entry.html?id=577

    Nice to know, thank you Hartti

Similar Threads

  1. 技术文档:MIDP 2.0安全机制 与 MIDlet 数字签名
    By wotrust in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 0
    Last Post: 2006-12-30, 07:42
  2. Wake a midlet up using an outgoing call
    By alonish in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-05, 13:55
  3. Is possible to call another page from one midlet
    By Gnanasekarcm in forum Mobile Java General
    Replies: 0
    Last Post: 2005-10-19, 08:30
  4. SX1 dialling initiates fax call instead of voice call
    By kdinn in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2005-08-25, 06:12
  5. Call C++ Routing from a MIDlet
    By Ghost RaideR in forum Mobile Java General
    Replies: 2
    Last Post: 2003-04-09, 10:00

Posting Permissions

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