×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Call Handling problem (Answering Call in Game)

    Hey All;

    I have problem in my game about handling incoming calls.

    I dont have any problem handling incoming calls showNotify() and hideNotify() methods.

    For an incoming call application is paused and resumed properly but If the incoming call is answered the application is not at the pause state anymore, probably hideNotify() is invoked and application continues to run when incoming call is answered.

    I will be happy If anyone have idea to handle this situation.

    Thanks in Advance.

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

    Re: Call Handling problem (Answering Call in Game)

    Quote Originally Posted by Reapertr View Post
    Hey All;

    I have problem in my game about handling incoming calls.

    I dont have any problem handling incoming calls showNotify() and hideNotify() methods.

    For an incoming call application is paused and resumed properly but If the incoming call is answered the application is not at the pause state anymore, probably hideNotify() is invoked and application continues to run when incoming call is answered.

    I will be happy If anyone have idea to handle this situation.

    Thanks in Advance.
    Try ignoring the 1st hideNotify call and resume only on 2nd one.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Call Handling problem (Answering Call in Game)

    When you get the hideNotify(), you should put your game in a paused state, but do not resume it on showNotify(). Many devices will show the app during the call. In your "paused state", provide an option for the user to resume the same. You'll find that this is what most commercial games do.

    Ideally, ignore the showNotify() method completely. Do not attempt to top threads in the hide and start them in the show... this is an often recommended technique, but it works very, very badly on some devices.

    Make sure you stop any sound you are playing in the hideNotify(). Some devices will continue playing sound in the background during the call if you don't stop it.

    Graham.

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Re: Call Handling problem (Answering Call in Game)

    Quote Originally Posted by grahamhughes View Post
    When you get the hideNotify(), you should put your game in a paused state, but do not resume it on showNotify(). Many devices will show the app during the call. In your "paused state", provide an option for the user to resume the same. You'll find that this is what most commercial games do.

    Ideally, ignore the showNotify() method completely. Do not attempt to top threads in the hide and start them in the show... this is an often recommended technique, but it works very, very badly on some devices.

    Make sure you stop any sound you are playing in the hideNotify(). Some devices will continue playing sound in the background during the call if you don't stop it.

    Graham.


    Sorry for the late response. Thank you for the both answers,

    I used the both of suggestions,1st hideNotify() is needed to be ignored to understand the incoming call properly.

    Since there is no way to learn to understand incoming call, I used hideNotify() like Graham suggested, put the game in Pause state and lets the user to continue. I didn't use showNotify() for resume.


    Also Graham thanks for the sound playing suggestion. I didn't recognize some devices are stopping the music during the call and some of them are playing. I also recognized another difference about the Sound playing.

    Most of the emulators and devices continue playing sound after phone call is finished but some of them stop playing the sound but some devices continue playing it. I used showNotify() in this situation to continue playing the sound again.

    Thanks in advance again.
    Last edited by Reapertr; 2011-02-03 at 12:28. Reason: Spelling mistakes

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Call Handling problem (Answering Call in Game)

    Quote Originally Posted by Reapertr View Post
    1st hideNotify() is needed to be ignored to understand the incoming call properly.
    You will get only one hideNotify() when a call arrives.

    The one thing you must be careful of: the technique of using hide/show to detect a call breaks down if you change Displayables. You should make sure you only ever call Display.setCurrent() once. Otherwise, you will get lots of other hide/show events.

    Quote Originally Posted by Reapertr View Post
    I used showNotify() in this situation to continue playing the sound again.
    I strongly recommend you don't do this. You will get a showNotify() on some devices before the call is over. Leave the game in the paused state, and resume the music only when the user selects "resume game".

    Graham.

Similar Threads

  1. Replies: 6
    Last Post: 2010-12-30, 05:21
  2. problem with call handling in n76
    By prashantchougule.cs in forum Symbian
    Replies: 11
    Last Post: 2010-04-23, 11:41
  3. Replies: 8
    Last Post: 2009-08-28, 05:16
  4. Problem in Answering Incoming call
    By apus29 in forum Symbian
    Replies: 9
    Last Post: 2009-04-16, 08:27
  5. Replies: 24
    Last Post: 2009-01-23, 09:13

Posting Permissions

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