How to make my application to run in background in series 60

Login to reply to this topic.
Fri, 2006-03-17 15:52
Joined: 2006-03-11
Forum posts: 43
How to make my application to run in background in series 60

      I am doing gui programming in series 60, in  my project when I click on that icon it shows to options
1, sleep
2, Exit
If I press sleep it will go to sleep for 60 seconds and every thing gets hanged for 60 seconds
Can any one   please say how to run my application in Background so that I can access other icons

thanking you
sheena

Fri, 2006-03-17 18:12
Joined: 2005-11-28
Forum posts: 101
Re: How to make my application in series 60
if u just want ur app to run in background just type the same letters in SEARCH on than forum and u ll find 1000 solutions... if u mean to do something for that 60 sec and in the same time do something else use some cactive object (timer or something)

BG
Sat, 2006-03-18 14:55
Joined: 2006-03-11
Forum posts: 43
Re: How to make my application to run in background in series 60
i even tried in this way but it is not going to  background
this is my code


void CSeleep2AppUi::HandleCommandL(TInt aCommand)
    {
    switch ( aCommand )
        {
        case EAknSoftkeyBack:
        case EEikCmdExit:
            {
            Exit();
            break;
            }
        case Eseleep2CmdAppTest:
            {
            SendToBackground();
                                
            iEikonEnv->InfoMsg(_L("test"));
            break;
            }
        default:
            break;     
        }
    }

void CSeleep2AppUi::SendToBackground()
{
   TApaTask task(iEikonEnv->WsSession( ));
   task.SetWgId(CEikonEnv::Static()->RootWin().Identifier());
   task.SendToBackground();
   sleep(60);

}


The main aim of my application is to make my application to run in back ground so that I can access other icons  in series 60 mobile
      But when I run my application I am unable to access other icons it is getting hang .


thanking you
sheena
Sat, 2006-03-18 15:52
Joined: 2005-11-28
Forum posts: 101
Re: How to make my application to run in background in series 60
why u use sleep(60) .. it freeze ur phone dont do this.. if u want ur app go to foreground after 60 sec use timer oir some active object..
Sun, 2006-03-26 15:48
Joined: 2006-03-26
Forum posts: 8
Re: How to make my application to run in background in series 60
Hi!

I tryed to use the code you provided to send my application into the background but I get a bunch of  linking errors.

Can you please help me?

Thanks!
Mon, 2006-03-27 08:23
Joined: 2005-08-11
Forum posts: 278
Re: How to make my application to run in background in series 60
Hi,

You can try out his...

TBool response = EFalse;
TApaTaskList taskList(CCoeEnv::Static()->WsSession());
TApaTask task = taskList.FindByPos(0);

CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(CCoeEnv::Static()->WsSession(), task.WgId());
if (wgName->AppUid().iUid == 0x10005bca) //ur application uid
{
response = ETrue;
task.SendToBackground();
}
CleanupStack::PopAndDestroy(wgName);

Include: apgtask.h and apgwgnam.h
Link against: apgrfx.lib in the mmp file
Sun, 2008-06-29 10:00
Joined: 2008-06-15
Forum posts: 25
Re: How to make my application to run in background in series 60

i am waking up this thread - is it safe to say the putting the App like this in background stops it from listening to events? such as CTelephony events?

Wed, 2008-07-02 09:52
Joined: 2004-11-29
Forum posts: 1155
Re: How to make my application to run in background in series 60

No.

"Being in the background" only means the app isn't currently showing any of its UI parts.

It doesn't affect anything else, all threads continue to run just as normal.

Sun, 2008-07-06 06:53
Joined: 2008-06-15
Forum posts: 25
Re: How to make my application to run in background in series 60

Thank you for your reply Smiling
what i cant understand is how can i listen to phone events in the background .... Sad
i followed and read all the examples and many threads in forums and still couldnt figure it out.
my app is in priority normal and i want to listen to "EDialing" event. i wrote the code and it doesnt work.
security reasons ?
i use s60 3rs FP1 , Nokia N95 as physical platform

Mon, 2008-07-07 09:51
Joined: 2004-11-29
Forum posts: 1155
Re: How to make my application to run in background in series 60

It could be many reasons, security is definitely one of them.

I havn't used CTelephony, but I suspect it might need you to set NetworkServices capability on your app.

You should try debug it and try find out more exactly how it "doesn't work", and if you don't figure it out from that, start a new thread about it here on NewLC and ask a more specific qestion.

  • Login to reply to this topic.