×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    19

    pauseApp never called?

    So it appears that series60 phones never call MIDlet.pauseApp() when an incoming call is received (which might explain why the emulators have no way to simulate an incoming call or a way to have pauseApp called). I've tried on a 6620 and 6682, please let me know if this is not a standard thing for series 60 phones. Of course other midp2 phones and emulators call pauseApp as you would expect, so I think it's just the symbian midp2 impl that's incorrect. But then nokia does not list this as a known issue...i'm stumped as to why?

    I see that others use the Canvas.showNotify and hideNotify methods to know when the app is paused, but this is not sufficient. There are many system alerts that come up that result in calls to hideNotify and showNotify, like asking the user for permission to use networking, connectivity, or sms or to ask which access point to use. Therefore using hideNotify and showNotify does not tell you if a call has interrupted the app.
    I also tried using Displayable.isShown, but once the call is answered my displayable is put back on the screen, so calls to isShown return true even though the user is still on the phone. This makes it impossible to know if there is currently a call in progress.

    Is there some series60 documentation on how midlets are suppose to behave when a call interrups the app? It seems this is an important thing, but since they don't follow the midp spec it's hard to figure out how to handle the situation. My specific problem is doing http posts and an incoming call is answered when you're waiting for the http response. Most of the time the call kills the GPRS connection and so when the call completes the http post just sits and waits and waits and never gets a response. The user has an option to abort and retry, but if I knew that an incoming call had interrupted the http post I could resend without making the user get involved.

    thanks for any insight.

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

    Re: pauseApp never called?

    Hi scole96,

    "Is there some series60 documentation on how midlets are suppose to behave when a call interrups the app?"

    You should check the docs below, i think they have answers to your doubts:

    Programming the MIDP Lifecycle on Symbian OS
    http://www.symbian.com/developer/tec...plifecycle.pdf

    What Java™ developers need to know about MIDP on Symbian OS
    http://www.symbian.com/developer/tec...ToKnow_1.0.pdf

    Some text excerpts:

    "Do not assume pauseApp is automatically called when a MIDlet is backgrounded (looses focus). On Series 60 pauseApp is not automatically called when a MIDlet is backgrounded, whereas on UIQ devices the AMS should call pauseApp when the MIDlet moves to the background"

    "On Symbian OS the behaviour of the AMS is customizable by the licensee. In particular the circumstances under which pauseApp is called vary between UI reference designs. On Series 60 pauseApp is not called when a MIDlet is backgrounded, whereas on UIQ phones the AMS should call pauseApp when the MIDlet moves to the background"

    Hope it helps!

    BR,

    Juarez Jr

  3. #3
    Regular Contributor
    Join Date
    Jan 2005
    Posts
    53

    Re: pauseApp never called?

    Hi ,

    try

    http://sw.nokia.com/id/ff51fcc6-edc0...on_v1_0_en.pdf

    and the following section:

    4.2.5 Handling of exits and interruptions

    Steve.
    Steve

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    19

    Re: pauseApp never called?

    Thanks for the quick responses and for the links - those are docs I should have already read. However, they do not resolve the problem. It seems that the symbian folks have taken some liberties with their implementation and left midp developers in a pickle. They say to use Displayable.isShown or Canvas.hideNotify/showNotify but as I stated above these methods do not handle informing you of an incoming call. I can use isShown to know if my displayable is not visible, which is the case for a few seconds when the user is deciding whether or not to answer a call, but once they answer my displayable is put back on the screen so isShown returns true and so I have no idea that a call is in progress. Show and hide have the problem of reporting numerous other events not related to a call coming in. And I really do not want to show an "app paused" screen every time a system alert is put up to ask the user about permission to do something or to pick an access point.
    I am trying to prepare our app for cingular certification testing of which one of the major things they say they test is handling of call interruption. I can't find a good way to do this on series 60 phones.
    Ok, I'm done with my rant, back to hacking together something that will have to suffice.

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

    Re: pauseApp never called?

    Most of the time the call kills the GPRS connection and so when the call completes the http post just sits and waits and waits and never gets a response. The user has an option to abort and retry, but if I knew that an incoming call had interrupted the http post I could resend without making the user get involved.

    Hi scole,
    Reagrding the above mentioned phenomenon,if an incoming call arrives can u just close the HTTP connection and switch the display to the Main menu or the menu just before it after the call gets over .so that you can avoid user wating for along time.User can do the connection once more if needed.since the incoming call have a more priority than the application,i think it is practicable.But i am not sure whether this is acceptable for your testing procedures.

    Thanks
    Soku

  6. #6
    Registered User
    Join Date
    Sep 2003
    Posts
    19

    Re: pauseApp never called?

    Soku123,
    That is exactly what I would like to do, but there is not sure way to know that an incoming call has occurred. As I stated above using Displayable.isShown and Canvas.hideNotify is not enough to know that a call has been received. I don't think the symbian jvm developer put enough thought into this as there examples and documentation all state that you can just use those methods to know. But you can't

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

    Re: pauseApp never called?

    Hi scole96,
    if the screen is a canvas screen that you are showing during an incoming call,then it is mandatory that the hidNotify method should be called.If not it is a phone software issue.I suppose and from my experience if Hidenotify is not called,then the isShown method will also not be called.

    Also check whether any of these methods will be called if u accept/reject the call.At times it may enter any of these methods.

    But surely this is a phone software issue.

    Thanks
    Soku

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    14

    Re: pauseApp never called?

    I was just reading this book "Pro J2ME Polish", by Robert Virkus, and notice on page 284:

    "On Series 40 Development PLatform 1.0 phones, the pauseApp() method of your MIDlet will never be caled, so you can detect whether your application is paused only by using the hideNotify() method of Canvas."

    It goes on to mention that this won't work with high level GUI screens (examples given of Form and List). The Application Management system will close the app via destroyApp if an uncaught exception occurs.

    Not sure how useful this is for you, just throwing it out there....

  9. #9
    Registered User
    Join Date
    Sep 2003
    Posts
    19

    Re: pauseApp never called?

    HideNotify is definitely called when an incoming call occurs as the series 60 phones will display the main phone screen (they call it the idle screen or something like that). The problem is that hideNotify is called for many other reasons, so assuming that when hideNotify is called that an incoming call is happening is incorrect. HideNotify is called whenever your screen is not the most visible screen which occurs when the jvm puts up system alerts - like to check permission or ask the user to choose the access point.

    so yes, hideNotify is called, but this is not enough. Neither is isShown since once the user answers or rejects the call my displayable is put back on the screen. So if a long running task is in progress (like an http post) and the user accepts the call quickly there is very little time that a call to isShown would return false since the app is quickly put back up.

  10. #10
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Re: pauseApp never called?

    If

    "Do not assume pauseApp is automatically called when a MIDlet is backgrounded (looses focus). On Series 60 pauseApp is not automatically called when a MIDlet is backgrounded, whereas on UIQ devices the AMS should call pauseApp when the MIDlet moves to the background"

    How do you figure out that a midlet has backgrounded?

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

    Re: pauseApp never called?

    Hi Larry101,

    AFAIK Displayable.isShown() for high-level UI, Canvas.hideNotify() and Canvas.showNotify() for low-level UI. Check the Javadocs for more information.

    HTH!

    Juarez Jr

  12. #12
    Regular Contributor
    Join Date
    Mar 2006
    Location
    South Africa
    Posts
    178

    Re: pauseApp never called?

    hi juarez,

    yep, you're right. my bad, i read the artile linked in this thread my martin de jode, and it works when use override hideNotify() and showNotify() in the canvas class. thanks for the help

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

    Re: pauseApp never called?

    Hi Larry101,

    Nevermind, glad it helped

    Juarez Jr

Similar Threads

  1. exe - destructor not being called
    By nubiah in forum Symbian
    Replies: 4
    Last Post: 2007-07-27, 10:25
  2. Replies: 2
    Last Post: 2004-08-24, 20:04
  3. Dialog's methods Draw(), CountComponentControls() not called
    By synov in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-05-25, 16:17
  4. pauseApp not being called on 3650?
    By fmhunter in forum Mobile Java Tools & SDKs
    Replies: 11
    Last Post: 2003-06-21, 21:05
  5. pauseApp() ever called on emulator?
    By Moruk79 in forum Mobile Java General
    Replies: 6
    Last Post: 1970-01-01, 02: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
  •  
×