×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    7

    Pausing an application

    Hello,

    I am using an active object to listen for an incoming call. I can detect this fine. However I would like then for my app ( not a game ) to be paued, or at least make it lose focus. I need to do this otherwise if the user needs to press buttons during the call i.e for voice mail etc.. the keys pressed are entered into my app and not into the phone.

    any ideas, thanks in advance

    Mark Griffiths.

  2. #2
    Registered User
    Join Date
    Apr 2003
    Location
    France
    Posts
    63
    Then you just need to ask your app to go to background when you detect the call. Check http://www.newlc.com/article.php3?id_article=141 to have more details on moving an app to background.

    Cheers,
    Eric

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    7
    Hey Eric,

    Thanks for the web page it helps alot. However I can't get it to function properly in an active object without the below line.

    Active object RunL code...........

    //Without this code dosen't work properly
    /CEikonEnv::Static()->InfoWinL(_L("Incoming Call"), _L(""));

    // Construct en empty TApaTask object
    // giving it a reference to the Window Server session.
    TApaTask task(iEikonEnv->WsSession( ));

    // Initialise the object with the window group id of
    // our application ( so that it represents our app ).
    task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());

    // Request window server to bring our application
    // to foreground.
    task.SendToBackground();

    more code..

    Thanks Mark.

    PS:: The code is not inside the active object but in a seperate function in the UI. I have a refrence to it from the active object.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    3

    incoming call event

    Hello Mark,

    would it be possible for you to help me in designing and Active object that is notified when there is an incoming call ? I am familiar with the active object but I don't know how to send an "incoming call notification" request.
    Thank you by advance
    TL

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    7
    Hey TL,

    I assume you know how to open a server,phone and line connenction. If not there are many examples on this site and the SDK or I can post it here if you want. Anyway here is the code that lets you listen for an incoming call.

    //This function is called right after ConstructL.
    void CActiveObject::IssueRequest()
    {
    // If A.Object is already active, panic.
    __ASSERT_ALWAYS( !IsActive(), User::Panic( _L( "CAssistPhoneMonitor" ), 1) );
    // Wait for incoming call.
    iLine.NotifyIncomingCall( iStatus, iIncomingCallName );
    // Set the A.Object active.
    SetActive();

    }

    //When a call is detected, this is automatically run by the program.
    void CActiveObject::RunL()
    {

    // Opens an existing call.
    iCall.OpenExistingCall( iLine, iIncomingCallName );

    RCall::TStatus lineStatus;
    User::LeaveIfError( iCall.GetStatus( lineStatus ) );

    // The call is connected and active.
    if ( lineStatus == RCall::EStatusConnected
    ||
    lineStatus == RCall::EStatusRinging )
    {
    put your code here, what do you want to do if the phone line is connected

    }
    else if ( lineStatus == RCall::EStatusHangingUp )
    {
    put your code here, what do you want to do if the phone call is terminated

    }

    // Cancel the request, should already be canceled.
    iLine.NotifyIncomingCallCancel();
    iCall.Close();
    // Start to listen for new incoming call.
    IssueRequest();
    }

    Hope this helps,

    Mark.

    PS: In DoCanacel close the server, phone an line and add this line before all of them.

    iLine.NotifyIncomingCallCancel();

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    3
    Hi Mark,

    thna

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    3
    Hi Mark,

    thank you for your fast answer. I am now able to detect the incoming phone call in the application except in one case and may you could help me again.
    Indeed the application I am desiging is sending some data (using RSocket) with a 3650: the problem I have is that during the very sending of data (the phone is connected to GPRS) the device does not answer to any incoming call: instead the call is sent to the operator voice mail. I don't know if it's possible to avoid this. May be it is an inherent behavior of the phone. Have you any idea ?
    Thanks a lot by advance
    TL

  8. #8
    Registered User
    Join Date
    Aug 2003
    Posts
    7
    Hey,

    I don't think its possible to avoid this as when the phone is sending dating the device is 'busy' and therefore can't recieve a phone call. Its a bit like if you are making a call and someone else tries to contact you they won't be able to. I'm not 100% sure but I think thats how it goes for GPRS.

    Mark.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    24
    Hello Mark,
    thanks a lot. I think you're right. I performed some tests with the Nokia Wap Service application on the 3650 and indeed when the device is in the process of sending/receiving bytes it appears busy to incoming calls. Though if you are connected to the GPRS network without sending data (just connected) then the incoming calls are detected and the GPRS connection is suspended. That's how I think it works. I'll continue investigating that more thorougly.
    Thanks for your help.
    TL

Posting Permissions

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