×
Namespaces

Variants
Actions
(Difference between revisions)

Autostart Qt applications at boot on Symbian devices

From Nokia Developer Wiki
Jump to: navigation, search
savaj (Talk | contribs)
(Updated article)
savaj (Talk | contribs)
m
Line 23: Line 23:
 
RESOURCE STARTUP_ITEM_INFO startexe
 
RESOURCE STARTUP_ITEM_INFO startexe
 
     {
 
     {
     executable_name = "!:\\sys\\bin\\StartEXE.exe";
+
     executable_name = "!:\\sys\\bin\\QtAutoStartApp.exe";
 
     recovery = EStartupItemExPolicyNone;
 
     recovery = EStartupItemExPolicyNone;
 
     }
 
     }
Line 29: Line 29:
  
 
In the code above:
 
In the code above:
* '''StartEXE.exe''' is the name of the application to be started and this will of course depend on your choice of name for your project. Must be the same as specified for the '''TARGET''' statement in the MMP file.
+
* '''QtAutoStartApp.exe''' is the name of the application to be started and this will of course depend on your choice of name for your project. Must be the same as specified for the '''TARGET''' statement in the MMP file.
  
 
'''2.''' Open your .PRO file.
 
'''2.''' Open your .PRO file.

Revision as of 15:41, 25 June 2010

{{{width}}}

Contents

Descriptions

For implementing autostart in Qt, we need to use Startup List Management API of symbian. The procedure to implement autostart in Qt is same as described in How to autostart an application on boot up in 3rd- Startup List Management API, so this article is, specially, useful to those developer who are not familiar with Symbian.

Startup List Management API

Steps for auto-starting an EXE on boot time in Qt for Symbian.

1. Create an .RSS file in your project's directories.

For example: 06000001.rss

Here a number is used for the name, which is the same as the Package UID (pUID) of the project. This might help later in identifying the resource and is a good reminder when adding the entry in the PKG file. The name is however irrelevant at this point.

Add the following code to the new .rss file:

#include <startupitem.rh>
 
RESOURCE STARTUP_ITEM_INFO startexe
{
executable_name = "!:\\sys\\bin\\QtAutoStartApp.exe";
recovery = EStartupItemExPolicyNone;
}

In the code above:

  • QtAutoStartApp.exe is the name of the application to be started and this will of course depend on your choice of name for your project. Must be the same as specified for the TARGET statement in the MMP file.

2. Open your .PRO file.

Add the following lines to include the new resource in the build and attach .RSC file to package.

symbian {
 
# Define rss file for autoboot
autoStartBlock = \
"SOURCEPATH ." \
"START RESOURCE 06000001.rss" \
"END"
 
MMP_RULES += autoStartBlock
 
# Deploy rsc file to package.
deployRscFile = "\"$${EPOCROOT}epoc32/data/06000001.rsc\" - \
\"C:/private/101f875a/import/[06000001].rsc\""

deployFiles.pkg_postrules += deployRscFile
DEPLOYMENT += deployFiles
}


3. That's it. Now just build the project and deploy sis file on device. On the next phone reboot your application will be started automatically.

Notes

  • If the EXE exits within a few (about 5?) seconds of starting up, a message is displayed, reading: Unable to start <name of EXE>. Application may need to be removed.
  • There are several Known Issues and Technical Solutions about using the Startup List logged in the Forum Nokia Technical Library. Search for "Startup List" to get an up-to-date overview.
  • Startup List Management API does not work with Self-Signed application. It should be signed with a trusted certificate (Open Signed Online or Open Signed Offline during R&D stage and Symbian Signed when released) even if otherwise the capabilities required for the project do not justify it.
  • The exe to be started must be installed directly from the root of the package that contains the resource file (not accepted from embedded file)

Download Example Code

Startup List Management Example in Qt

See also

164 page views in the last 30 days.