×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    19

    Post Little problem: autostart + starter

    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:
    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);
    
    }
    the above function is called from CreateRecognizer().


    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:

    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
    }
    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.
    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.
    Last edited by edcruise; 2007-08-29 at 22:15.

Similar Threads

  1. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  2. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  3. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  4. about autostart problem
    By ld_road in forum Symbian
    Replies: 1
    Last Post: 2005-01-11, 01:15

Posting Permissions

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