Hi at all,
I've a little problem with autostart + starter program found at Mika symbian site.
I wanto to start my application at phone boot, not directly but using another program that works like a watchdog, or rather starts the application if it fails for any problem.
Then i use the code found at above site, on the net i found only this method to auto start a program with watchdog at phone boot.
I have 2 little problem:
1. How can i run program background ??
Follow core code used in auto start:
the above function is called from CreateRecognizer().Code:void CclAutostart::StartAppThreadFunctionL() { #ifdef __WINS__ //This is the uid of the starter application,which you want to autostart. const TUid starter_uid= { 0x05CCC0B0 }; RApaLsSession ls; User::LeaveIfError(ls.Connect()); CleanupClosePushL(ls); _LIT(filen, ""); // dummy TThreadId dummy; User::LeaveIfError( ls.StartDocument(filen, starter_uid, dummy) ); CleanupStack::PopAndDestroy(); #else //Replace this starter.app with the app which you want to autostart. TFileName fnAppPath = _L("\\system\\apps\\starter\\starter.exe"); RProcess server; CleanupClosePushL(server); User::LeaveIfError(server.Create(fnAppPath, _L(""))); server.Resume(); CleanupStack::PopAndDestroy(); #endif User::Exit(0); }
2. My application does not start from starter program. I don't know why, and this is my more great problem. In starter i add a console to write into and have some feedback, but it seems that call to my application fails.
Follow the code:
After starter starts from recognizer, i see only log into console "mainloop". The other log "after called" is not displayed, then called processHandle.Create(fnAppPath, _L("")) does not work e does not return in right way.Code:void mainloop(void) { CConsoleBase* console; console=Console::NewL(_L("Test console"),TSize (KConsFullScreen,KConsFullScreen)); // Create a consol CleanupStack::PushL(console); console->Printf(_L("mainloop\n")); TFileName fnAppPath = L("\\system\\apps\\HelloWorld\\HelloWorld.app"); RProcess processHandle; CleanupClosePushL(processHandle); User::LeaveIfError(processHandle.Create(fnAppPath, _L(""))); processHandle.Resume(); CleanupStack::PopAndDestroy(); console->Printf(_L("after called\n")); console->Getch(); // get and ignore character CleanupStack::PopAndDestroy(); //console }
If i start HelloWorld.app application from menu, it works, but programmatically fails. Maybe exists another method to launch application ??
Please help me, i'm in trouble.
After i resolve my problem, I would like to publish a little tutorial that cover this problematic.
Thanks in advance,
regards edcruise.

Reply With Quote

