diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,97 @@ + + + + + +Managing +a Dynamic Startup Configuration +
Introduction

Managing a Dynamic Startup Configuration +(DSC) corresponds to the process of adding, modifying and +removing items from a DSC. For example, a device creator can add an AMC (After +Market Component) to a DSC, which is required to be started at phone boot +time along with other AMCs. Another example can be a device creator wishing +to change the start up behavior of an AMC, so that it can start in the background.

You +can use RDscStore and CDscItem to manage +a DSC. CDscItem is dependant upon common startup classes CStartupProperties, TStartupMethod, TStartupType and TRestartAction.

Usage +of RDscStore is straightforward. You need to create an +instance of RDscStore, call OpenL() and +use the functions as appropriate. Most of the functions leave with error codes, +rather than returning. The error code is typically KErrNotReady, +if the DSC database is not set up, or the code returned by the encapsulated +database client.

Note that RDscStore is NOT derived +from RSessionBase.

+
Procedure

Adding +an item to a DSC

    +
  1. Create the DSC item +using CDscItem.

    TUid iDscUid; +iDscUid = TUid::Uid(KDefaultSymbianDsc); + +//Create the instance +CDscItem* dscItem = CDscItem::NewL(); +CleanupStack::PushL(dscItem); + +dscItem->SetDscId(iDscUid); + +//Define the name of the AMC +_LIT( filename, "mypackage.exe"); + +//Arguments for the AMC +TPtrC amaArgs; +... + +//Set the file parameters for the AMC +dscItem->SetFileParamsL(filename, amaArgs); + +//Set the start-up properties for the AMC +dscItem->SetStartupTypeL(TStartupType::EStartProcess); +dscItem->SetStartMethodL(TStartMethod::EFireAndForget); +dscItem->SetNoOfRetriesL(TNoOfRetries::ERetry0); + +... + +CleanupStack::PopAndDestroy(dscItem);
  2. +
  3. Add the DSC item to +the DSC using RDscStore::AddItemL().

    RDscStore dscClient; +dscClient.OpenL(); +CleanupClosePushL(dscClient); + +... + +dscClient.AddItemL(*dscItem); +CleanupStack::PopAndDestroy();
  4. +

Modifying an item +in a DSC

    +
  1. Make changes to the +DSC item as per your requirement using the functions of CDscItem.

    CDscItem* dscItem = CDscItem::NewL(); +CleanupStack::PushL(dscItem); + +//Change the start-up properties for the AMC +dscItem->SetStartupTypeL(TStartupType::EStartApp); +dscItem->SetStartMethodL(TStartMethod::EWaitForStart); +dscItem->SetNoOfRetriesL(TNoOfRetries::ERetry1); + +... + +CleanupStack::PopAndDestroy(dscItem);
  2. +
  3. Pass the updated DSC +item to the DSC using RDscStore::UpdateItemL().

    RDscStore dscClient; +dscClient.OpenL(); +CleanupClosePushL(dscClient); + +... + +dscClient.UpdateItemL(*dscItem); +CleanupStack::PopAndDestroy();
  4. +
+
+ After Market +Application Starter Overview +Creating +a Dynamic Startup Configuration +
\ No newline at end of file