How to make my application to run in background in series 60
| Fri, 2006-03-17 15:52 | |
|
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 |
|






Forum posts: 101
BG
Forum posts: 43
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
Forum posts: 101
Forum posts: 8
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!
Forum posts: 278
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
Forum posts: 25
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?
Forum posts: 1155
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.
Forum posts: 25
Thank you for your reply

what i cant understand is how can i listen to phone events in the background ....
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
Forum posts: 1155
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.