×

Discussion Board

Results 1 to 10 of 10

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    autostart doesnt work

    I compiled Eduard's code and got a MDL file.
    I put the name of the app I want to auto start in this line :
    TFileName fnAppPath = _L("\\system\\apps\\myapp\\myapp.app");

    what do I do now ?
    do I need a reference from the app to the MDL ?
    I run the emulator and nothing happens , I also have no idea if the module is activated at all...

    Please advise ,
    Thanks , TE

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    78

    Recogniser

    Hi,

    I assume that you have read the following posts:

    http://discussion.forum.nokia.com/fo...2Aautostart%2A

  3. #3
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    yes I did . update :

    I managed to run the app with autostart ,
    now I try to put it in the background , with no success.
    the Timer lines are in comment like Eduard wrote them in his code , but this still didnt help , the app starts in the foreground .
    I tried also to add one line to the code (as you can see below) ,
    but still , no success .

    any ideas ?

    Code:
    void CMyRecognizer::StartAppThreadFunctionL()
    {
    .
    .
    .
    	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    	cmdLine->SetLibraryNameL( findFile.File() );
    	cmdLine->SetCommandL( EApaCommandOpen );
    	cmdLine->SetCommandL( EApaCommandBackground );
    
    .
    .
    .
    }

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    United Kingdom
    Posts
    78

    autostart in background

    Ok, I had a similar issue. Not sure how to correctly resolve it. In my app I placed the following code in the appropriate place, which sends my application into the background. If you do decide to use this, ensure that the class that you place this code in is derived from CAknView or something similar or you won't have an iCoeEnv object to use.

    TApaTask task( iCoeEnv->WsSession() );
    task.SetWgId( iWgId );
    task.SendToBackground();

    good luck

  5. #5
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    Hi

    thanks for the additional info.
    I tried to put this code in the construct of the AppUi and also in the view before and after activating the list (a view with a list).

    both options didnt work :-(

    by the way I left these lines in the recognizer :
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetLibraryNameL( findFile.File() );
    cmdLine->SetCommandL( EApaCommandBackground );

    any suggestions ?

  6. #6
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    when I say didnt work ...

    I mean that the app runs in the foreground when turning the phone on ...

  7. #7
    Regular Contributor
    Join Date
    May 2004
    Location
    NRW/ Germany
    Posts
    188
    Hi,

    you have to replace this line:

    cmdLine->SetCommandL( EApaCommandOpen ); // for starting app in foreground

    in your recognizer with this:

    cmdLine->SetCommandL(EApaCommandBackground); // for starting app in background

    Don't put it in the AppUi. Should start the application hidden in the background as you want it.

    Arne

  8. #8
    Regular Contributor
    Join Date
    Apr 2004
    Posts
    322

    I already do that :

    my last posts refer to this code :
    cmdLine->SetCommandL( EApaCommandBackground );

    I deleted this line :
    cmdLine->SetCommandL( EApaCommandOpen );

    but it still doesnt work ...

  9. #9
    jp4symbian
    Guest

    Exclamation Re: autostart doesnt work

    Hi white_dragon,

    Have u been able to solve this problem?
    I have been trying to search on all possible threads on this forum for "Autostart" ,"recognizer" etc. but haven't found a solution as to how to send an application in background after it is Autostarted after device boot.

    At present my application is auto started using an mdl created using the code from http://mikie.iki.fi/symbian/autostart.html
    But it comes to the foreground once it is Autostarted. I know I can send an application to background from the link:
    http://www.newlc.com/Moving-an-application-to.html

    But then if the user exits this application and manually starts it again, then also it will go to background.

    Is there some way to determine whether an application has been launched by the mdl after boot or if the user has launched it?
    I want the solution for Series 60 2nd edition devices.


    I know that such a solution already exists for 3rd Edition devices at:
    http://newlc.com/How-to-detect-if-an...cation-is.html


    If anyone viewing this thread has the solution, please post the reply here.
    Thanks in advance.

  10. #10
    jp4symbian
    Guest

    Re: autostart doesnt work

    hey folks,
    i solved my problem.

    The following code snippet works well for sending an application to background after launching it through a recognizer on startup:

    _LIT(KAppName,"Test.app");
    TBuf<100> appName(KAppName);
    CApaCommandLine * cmd=CApaCommandLine::NewL();
    cmd->SetLibraryNameL(appName);

    cmd->SetCommandL(EApaCommandBackground);
    EikDll::StartAppL(*cmd);

Posting Permissions

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